diff options
author | udovichenko-r <udovichenko-r@yandex-team.com> | 2024-11-19 14:58:38 +0300 |
---|---|---|
committer | udovichenko-r <udovichenko-r@yandex-team.com> | 2024-11-19 15:16:27 +0300 |
commit | 24521403b1c44303e043ba540c09b1fe991c7474 (patch) | |
tree | 341d1e7206bc7c143d04d2d96f05b6dc0655606d /yql/essentials/tests/sql/suites/pragma | |
parent | 72b3cd51dc3fb9d16975d353ea82fd85701393cc (diff) | |
download | ydb-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/pragma')
21 files changed, 165 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/pragma/classic_division.sql b/yql/essentials/tests/sql/suites/pragma/classic_division.sql new file mode 100644 index 0000000000..a6988269f3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/classic_division.sql @@ -0,0 +1,16 @@ +/* postgres can not */ +SELECT 1 / 2; + +PRAGMA ClassicDivision("false"); +SELECT 3 / 4; +PRAGMA ClassicDivision("true"); +SELECT 5 / 6; + +DEFINE ACTION $div_8_by_value($value) AS + PRAGMA ClassicDivision("false"); + SELECT 8 / $value; +END DEFINE; + +DO $div_8_by_value(9); + +SELECT 10 / 11; diff --git a/yql/essentials/tests/sql/suites/pragma/classic_division.sqlx b/yql/essentials/tests/sql/suites/pragma/classic_division.sqlx new file mode 100644 index 0000000000..952eac04ac --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/classic_division.sqlx @@ -0,0 +1,3 @@ +/* postgres can not */ +$x = "false"; +PRAGMA ClassicDivision = $x; diff --git a/yql/essentials/tests/sql/suites/pragma/config_exec.cfg b/yql/essentials/tests/sql/suites/pragma/config_exec.cfg new file mode 100644 index 0000000000..ad52c79527 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/config_exec.cfg @@ -0,0 +1,2 @@ +in Input input.txt +out Output output.txt diff --git a/yql/essentials/tests/sql/suites/pragma/config_exec.sql b/yql/essentials/tests/sql/suites/pragma/config_exec.sql new file mode 100644 index 0000000000..4e83143e42 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/config_exec.sql @@ -0,0 +1,10 @@ +/* postgres can not */ +USE plato; + +INSERT INTO Output +SELECT "1" as key, "1" as subkey, "1" as value; + +PRAGMA File("file", "dummy"); + +INSERT INTO Output +SELECT * from Input where key < "030"; diff --git a/yql/essentials/tests/sql/suites/pragma/default.cfg b/yql/essentials/tests/sql/suites/pragma/default.cfg new file mode 100644 index 0000000000..8d1c8b69c3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/default.cfg @@ -0,0 +1 @@ + diff --git a/yql/essentials/tests/sql/suites/pragma/file.sql b/yql/essentials/tests/sql/suites/pragma/file.sql new file mode 100644 index 0000000000..d252d8dbe5 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/file.sql @@ -0,0 +1 @@ +pragma file("HW", "sbr:181041334"); diff --git a/yql/essentials/tests/sql/suites/pragma/input.txt b/yql/essentials/tests/sql/suites/pragma/input.txt new file mode 100644 index 0000000000..65949ea745 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/input.txt @@ -0,0 +1,4 @@ +{"key"="075";"subkey"="1";"value"="abc"}; +{"key"="800";"subkey"="2";"value"="ddd"}; +{"key"="020";"subkey"="3";"value"="q"}; +{"key"="150";"subkey"="4";"value"="qzz"}; diff --git a/yql/essentials/tests/sql/suites/pragma/messages.sqlx b/yql/essentials/tests/sql/suites/pragma/messages.sqlx new file mode 100644 index 0000000000..09b5d72e54 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/messages.sqlx @@ -0,0 +1,5 @@ +/* postgres can not */ +PRAGMA Greetings; +PRAGMA Greetings("It's a good day!"); +PRAGMA WarningMsg("Ready to fight!"); +PRAGMA ErrorMsg("Loose!"); diff --git a/yql/essentials/tests/sql/suites/pragma/messages_warning_action.sqlx b/yql/essentials/tests/sql/suites/pragma/messages_warning_action.sqlx new file mode 100644 index 0000000000..fa577be58e --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/messages_warning_action.sqlx @@ -0,0 +1,6 @@ +/* postgres can not */ +/* not supported on windows */ +PRAGMA Warning("error", '4500'); +PRAGMA Greetings; +PRAGMA Greetings("It's a good day!"); +PRAGMA WarningMsg("Ready to fight!"); diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.cfg b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.cfg new file mode 100644 index 0000000000..1b5feeea00 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.cfg @@ -0,0 +1,2 @@ +providers yt +in Input input.txt diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.sql b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.sql new file mode 100644 index 0000000000..8fd8207414 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull.sql @@ -0,0 +1,23 @@ +/* kikimr can not */ +USE plato; + +PRAGMA yt.ReleaseTempData="immediate"; +PRAGMA yt.InflightTempTablesLimit="6"; + +DEFINE ACTION $action($param) AS + +$key = CAST($param as String); + +$a = "Input"; +$b = (SELECT key,value FROM $a WHERE key != ($key || ".1") GROUP BY key, value ORDER BY value LIMIT 10); +$c = (SELECT key,value FROM $b WHERE key != ($key || ".2") GROUP BY key, value ORDER BY value LIMIT 10); +$d = (SELECT key,value FROM $c WHERE key != ($key || ".3") GROUP BY key, value ORDER BY value LIMIT 10); +$e = (SELECT key,value FROM $d WHERE key != ($key || ".4") GROUP BY key, value ORDER BY value LIMIT 10); +$f = (SELECT key,value FROM $e WHERE key != ($key || ".5") GROUP BY key, value ORDER BY value LIMIT 10); +$g = (SELECT key,value FROM $f WHERE key != ($key || ".6") GROUP BY key, value ORDER BY value LIMIT 10); + +PROCESS $g; + +END DEFINE; + +EVALUATE FOR $param IN ListFromRange(1, 3) DO $action($param); diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.cfg b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.cfg new file mode 100644 index 0000000000..8896f1030d --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.cfg @@ -0,0 +1,3 @@ +xfail +providers yt +in Input input.txt diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.sql b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.sql new file mode 100644 index 0000000000..ae0813c283 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_fail.sql @@ -0,0 +1,24 @@ +USE plato; + +PRAGMA yt.ReleaseTempData="finish"; +PRAGMA yt.InflightTempTablesLimit="6"; + +/* custom error:Too many temporary tables registered - limit is 6*/ + +DEFINE ACTION $action($param) AS + +$key = CAST($param as String); + +$a = "Input"; +$b = (SELECT key,value FROM $a WHERE key != ($key || ".1") GROUP BY key, value ORDER BY value LIMIT 10); +$c = (SELECT key,value FROM $b WHERE key != ($key || ".2") GROUP BY key, value ORDER BY value LIMIT 10); +$d = (SELECT key,value FROM $c WHERE key != ($key || ".3") GROUP BY key, value ORDER BY value LIMIT 10); +$e = (SELECT key,value FROM $d WHERE key != ($key || ".4") GROUP BY key, value ORDER BY value LIMIT 10); +$f = (SELECT key,value FROM $e WHERE key != ($key || ".5") GROUP BY key, value ORDER BY value LIMIT 10); +$g = (SELECT key,value FROM $f WHERE key != ($key || ".6") GROUP BY key, value ORDER BY value LIMIT 10); + +PROCESS $g; + +END DEFINE; + +EVALUATE FOR $param IN ListFromRange(1, 3) DO $action($param); diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.cfg b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.cfg new file mode 100644 index 0000000000..1b5feeea00 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.cfg @@ -0,0 +1,2 @@ +providers yt +in Input input.txt diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.sql b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.sql new file mode 100644 index 0000000000..fcd945613f --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread.sql @@ -0,0 +1,23 @@ +/* kikimr can not */ +USE plato; + +PRAGMA yt.ReleaseTempData="immediate"; +PRAGMA yt.InflightTempTablesLimit="3"; + +DEFINE ACTION $action($param) AS + +$key = CAST($param as String); + +$a = "Input"; +$b = (SELECT key,value FROM $a WHERE key != ($key || ".1") GROUP BY key, value ORDER BY value LIMIT 10); +$c = (SELECT key,value FROM $b WHERE key != ($key || ".2") GROUP BY key, value ORDER BY value LIMIT 10); +$d = (SELECT key,value FROM $c WHERE key != ($key || ".3") GROUP BY key, value ORDER BY value LIMIT 10); +$e = (SELECT key,value FROM $d WHERE key != ($key || ".4") GROUP BY key, value ORDER BY value LIMIT 10); +$f = (SELECT key,value FROM $e WHERE key != ($key || ".5") GROUP BY key, value ORDER BY value LIMIT 10); +$g = (SELECT key,value FROM $f WHERE key != ($key || ".6") GROUP BY key, value ORDER BY value LIMIT 10); + +PROCESS $g; + +END DEFINE; + +EVALUATE FOR $param IN ListFromRange(1, 2) DO $action($param); diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.cfg b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.cfg new file mode 100644 index 0000000000..8896f1030d --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.cfg @@ -0,0 +1,3 @@ +xfail +providers yt +in Input input.txt diff --git a/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.sql b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.sql new file mode 100644 index 0000000000..c8dc1a2ac3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/release_temp_data_chain_pull_single_thread_fail.sql @@ -0,0 +1,25 @@ +/* dq can not */ +USE plato; + +PRAGMA yt.ReleaseTempData="immediate"; +PRAGMA yt.InflightTempTablesLimit="2"; + +/* custom error:Too many temporary tables registered - limit is 2*/ + +DEFINE ACTION $action($param) AS + +$key = CAST($param as String); + +$a = "Input"; +$b = (SELECT key,value FROM $a WHERE key != ($key || ".1") GROUP BY key, value ORDER BY value LIMIT 10); +$c = (SELECT key,value FROM $b WHERE key != ($key || ".2") GROUP BY key, value ORDER BY value LIMIT 10); +$d = (SELECT key,value FROM $c WHERE key != ($key || ".3") GROUP BY key, value ORDER BY value LIMIT 10); +$e = (SELECT key,value FROM $d WHERE key != ($key || ".4") GROUP BY key, value ORDER BY value LIMIT 10); +$f = (SELECT key,value FROM $e WHERE key != ($key || ".5") GROUP BY key, value ORDER BY value LIMIT 10); +$g = (SELECT key,value FROM $f WHERE key != ($key || ".6") GROUP BY key, value ORDER BY value LIMIT 10); + +PROCESS $g; + +END DEFINE; + +EVALUATE FOR $param IN ListFromRange(1, 2) DO $action($param); diff --git a/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.cfg b/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.cfg new file mode 100644 index 0000000000..06764a39ce --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.cfg @@ -0,0 +1 @@ +udf yson2_udf diff --git a/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.sql b/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.sql new file mode 100644 index 0000000000..01cb8bf33f --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/yson_auto_convert.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +PRAGMA yson.AutoConvert; +PRAGMA yson.Strict; + +SELECT Yson::ConvertToString(Yson("[123;]").0); diff --git a/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.cfg b/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.cfg new file mode 100644 index 0000000000..cf17d0b8d0 --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.cfg @@ -0,0 +1,2 @@ +xfail +udf yson2_udf diff --git a/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.sql b/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.sql new file mode 100644 index 0000000000..1db347862d --- /dev/null +++ b/yql/essentials/tests/sql/suites/pragma/yson_strict_fail.sql @@ -0,0 +1,4 @@ +/* postgres can not */ +PRAGMA yson.Strict; + +SELECT Yson::ConvertToString(Yson("122")); |