aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/schema
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-11-20 11:14:58 +0000
committerAlexander Smirnov <alex@ydb.tech>2024-11-20 11:14:58 +0000
commit31773f157bf8164364649b5f470f52dece0a4317 (patch)
tree33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /yql/essentials/tests/sql/suites/schema
parent2c7938962d8689e175574fc1e817c05049f27905 (diff)
parenteff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff)
downloadydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz
Merge branch 'rightlib' into mergelibs-241120-1113
Diffstat (limited to 'yql/essentials/tests/sql/suites/schema')
-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
196 files changed, 865 insertions, 0 deletions
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;