aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql
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/in/in_tablesource_to_equijoin.sql
parent2c7938962d8689e175574fc1e817c05049f27905 (diff)
parenteff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff)
downloadydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz
Merge branch 'rightlib' into mergelibs-241120-1113
Diffstat (limited to 'yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql')
-rw-r--r--yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql27
1 files changed, 27 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql b/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql
new file mode 100644
index 0000000000..60ebfb97d9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/in/in_tablesource_to_equijoin.sql
@@ -0,0 +1,27 @@
+/* postgres can not */
+
+USE plato;
+
+$r4_20 = (SELECT optkey FROM Input WHERE optkey BETWEEN 4 AND 20);
+$r6_20 = (SELECT key FROM Input WHERE optkey BETWEEN 6 AND 20);
+$r8_20 = (SELECT key FROM Input WHERE optkey BETWEEN 8 AND 20);
+$r10_20 = (SELECT optkey FROM Input WHERE optkey BETWEEN 10 AND 20);
+
+$r1_16 = (SELECT optkey FROM Input WHERE optkey BETWEEN 1 AND 16);
+$r1_12 = (SELECT key FROM Input WHERE optkey BETWEEN 1 AND 12);
+
+SELECT key FROM Input WHERE
+ (key + 1) IN $r4_20 AND -- key = [3, 19] -- 2 joinable
+ optkey IN $r6_20 AND -- key = [6, 19]
+
+ key IN /*+ COMPACT() */ $r8_20 AND -- key = [8, 19] -- 1 nonjoinable (due to COMPACT)
+
+ (optkey + 3) IN $r10_20 AND -- key = [8, 17] -- 3 joinable
+ (key + 4) NOT IN $r1_12 AND -- key = [9, 17]
+ key IN $r10_20 AND -- key = [10, 17]
+
+ (optkey IN $r1_16 OR key IN $r1_16) AND -- key = [10, 16] -- 1 nonjoinable (not SqlIn)
+
+ (key - 1) IN $r1_12 AND -- key = [10, 13] -- 2 joinable
+ (key - 3) NOT IN $r8_20 -- key = [10]
+