aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/insert_monotonic
diff options
context:
space:
mode:
authorudovichenko-r <udovichenko-r@yandex-team.com>2024-11-19 14:58:38 +0300
committerudovichenko-r <udovichenko-r@yandex-team.com>2024-11-19 15:16:27 +0300
commit24521403b1c44303e043ba540c09b1fe991c7474 (patch)
tree341d1e7206bc7c143d04d2d96f05b6dc0655606d /yql/essentials/tests/sql/suites/insert_monotonic
parent72b3cd51dc3fb9d16975d353ea82fd85701393cc (diff)
downloadydb-24521403b1c44303e043ba540c09b1fe991c7474.tar.gz
YQL-19206 Move contrib/ydb/library/yql/tests/sql/suites -> yql/essentials/tests/sql/suites
commit_hash:d0ef1f92b09c94db7c2408f946d2a4c62b603f00
Diffstat (limited to 'yql/essentials/tests/sql/suites/insert_monotonic')
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.sql7
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/default.cfg6
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/from_empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/from_empty.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input1.txt2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input1.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input2.txt2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input2.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input3.txt1
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input3.txt.attr7
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input4.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/input4.txt.attr21
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/keep_meta.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.sql7
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/several1.sql8
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/several2.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt0
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt.attr11
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt4
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt.attr21
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/to_empty.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/to_empty.sql5
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/truncate_and_append.sql9
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.sql5
37 files changed, 228 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.cfg
new file mode 100644
index 0000000000..f534ef41b5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input1 input1.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.sql
new file mode 100644
index 0000000000..a44b306f32
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/break_sort_fail.sql
@@ -0,0 +1,5 @@
+use plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input1
+;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.cfg
new file mode 100644
index 0000000000..a517989811
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input4.txt
+out Output sorted_unique.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.sql
new file mode 100644
index 0000000000..00865ab6c3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/break_unique_fail.sql
@@ -0,0 +1,7 @@
+/* ytfile can not */
+/* dqfile can not */
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT DISTINCT * FROM Input
+ORDER BY key, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/default.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/default.cfg
new file mode 100644
index 0000000000..a615fc5955
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/default.cfg
@@ -0,0 +1,6 @@
+in Input1 input1.txt
+in Input2 input2.txt
+in Input4 input4.txt
+in Input5 input5.txt
+out Output sorted.txt
+
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.cfg
new file mode 100644
index 0000000000..cbcd5e6ebb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.cfg
@@ -0,0 +1,2 @@
+in EmptyInput sorted_empty.txt
+out Output sorted.txt \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.sql b/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.sql
new file mode 100644
index 0000000000..12a4cd2d3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/from_empty.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM EmptyInput
+ORDER BY key, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt b/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt
new file mode 100644
index 0000000000..9b007a435c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt
@@ -0,0 +1,2 @@
+{"key"="201";"subkey"="3";"value"="aaa"};
+{"key"="202";"subkey"="5";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input1.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt b/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt
new file mode 100644
index 0000000000..10fcfb562a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt
@@ -0,0 +1,2 @@
+{"key"="203";"subkey"="3";"value"="aaa"};
+{"key"="204";"subkey"="5";"value"="ddd"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input2.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt b/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt
new file mode 100644
index 0000000000..b088aadfed
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt
@@ -0,0 +1 @@
+{"key"="149";"subkey"="1";"value"="aaa"}; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt.attr
new file mode 100644
index 0000000000..f4e2c10c67
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input3.txt.attr
@@ -0,0 +1,7 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt b/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt
new file mode 100644
index 0000000000..f2da650820
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt
@@ -0,0 +1,4 @@
+{"key"="200";"subkey"="3";"value"="aaa"};
+{"key"="201";"subkey"="1";"value"="ddd"};
+{"key"="201";"subkey"="1";"value"="abc"};
+{"key"="202";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt.attr
new file mode 100644
index 0000000000..dda2f66d5e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/input4.txt.attr
@@ -0,0 +1,21 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %false
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/keep_meta.sql b/yql/essentials/tests/sql/suites/insert_monotonic/keep_meta.sql
new file mode 100644
index 0000000000..cf797537e8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/keep_meta.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO Output WITH (MONOTONIC_KEYS, KEEP_META, TRUNCATE)
+SELECT * FROM Input1
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.cfg
new file mode 100644
index 0000000000..407769fc34
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+out Output sorted_unique.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.sql b/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.sql
new file mode 100644
index 0000000000..9721c1b113
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/keep_unique.sql
@@ -0,0 +1,9 @@
+/* ytfile can not */
+/* dqfile can not */
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT key, subkey, some(value) as value
+FROM Input
+GROUP BY key, subkey
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.cfg
new file mode 100644
index 0000000000..5625fb3b45
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.cfg
@@ -0,0 +1,2 @@
+xfail
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.sql
new file mode 100644
index 0000000000..fe58dae84c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/non_existing_fail.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT 1 as key
+ORDER BY key; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.cfg
new file mode 100644
index 0000000000..be41f68e2e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input1 input1.txt
+in Input2 input2.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.sql
new file mode 100644
index 0000000000..a209e180d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/not_all_fail.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input1
+ORDER BY key, subkey;
+
+INSERT INTO Output
+SELECT * FROM Input2
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.cfg
new file mode 100644
index 0000000000..1b0d1ea529
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input3.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.sql
new file mode 100644
index 0000000000..ec7888b052
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/overlaping_fail.sql
@@ -0,0 +1,7 @@
+/* ytfile can not */
+/* dqfile can not */
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input
+ORDER BY key, subkey; \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/several1.sql b/yql/essentials/tests/sql/suites/insert_monotonic/several1.sql
new file mode 100644
index 0000000000..f0f3f00b24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/several1.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+INSERT INTO Output
+WITH MONOTONIC_KEYS
+SELECT * FROM Input1
+UNION ALL
+SELECT * FROM Input2
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/several2.sql b/yql/essentials/tests/sql/suites/insert_monotonic/several2.sql
new file mode 100644
index 0000000000..409f0b120e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/several2.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input1
+ORDER BY key, subkey;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input2
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt b/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt.attr
new file mode 100644
index 0000000000..ed13e20223
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_empty.txt.attr
@@ -0,0 +1,11 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["key";["DataType";"String"]];
+ ["subkey";["DataType";"String"]];
+ ["value";["DataType";"String"]]
+ ]];
+ "SortDirections"=[1;1;];
+ "SortedBy"=["key";"subkey";];
+ "SortedByTypes"=[["DataType";"String";];["DataType";"String";];];
+ "SortMembers"=["key";"subkey";];
+}}
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt
new file mode 100644
index 0000000000..2a8e728cae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt
@@ -0,0 +1,4 @@
+{"key"="023";"subkey"="3";"value"="aaa"};
+{"key"="037";"subkey"="5";"value"="ddd"};
+{"key"="075";"subkey"="1";"value"="abc"};
+{"key"="150";"subkey"="1";"value"="aaa"};
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt.attr b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt.attr
new file mode 100644
index 0000000000..eeee4c32ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/sorted_unique.txt.attr
@@ -0,0 +1,21 @@
+{
+ "schema"=<
+ "strict" = %true;
+ "unique_keys" = %true
+ >[
+ {
+ "name" = "key";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "subkey";
+ "type" = "string";
+ "sort_order" = "ascending";
+ };
+ {
+ "name" = "value";
+ "type" = "string";
+ };
+ ]
+} \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.cfg
new file mode 100644
index 0000000000..01364c3d38
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.cfg
@@ -0,0 +1,2 @@
+in Input input1.txt
+out EmptyOutput sorted_empty.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.sql b/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.sql
new file mode 100644
index 0000000000..b9cfd780bb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/to_empty.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO EmptyOutput WITH MONOTONIC_KEYS
+SELECT * FROM Input
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/truncate_and_append.sql b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_and_append.sql
new file mode 100644
index 0000000000..6279af1bd9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_and_append.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+INSERT INTO Output WITH TRUNCATE
+SELECT * FROM Input1
+ORDER BY key, subkey;
+
+INSERT INTO Output WITH MONOTONIC_KEYS
+SELECT * FROM Input2
+ORDER BY key, subkey;
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.cfg b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.cfg
new file mode 100644
index 0000000000..88b7afd164
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+in Input input1.txt
+out Output sorted.txt
diff --git a/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.sql b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.sql
new file mode 100644
index 0000000000..374d347fbf
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/insert_monotonic/truncate_fail.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+INSERT INTO Output WITH (MONOTONIC_KEYS, TRUNCATE)
+SELECT * FROM Input
+ORDER BY key, subkey;