aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-11-20 17:37:57 +0000
committerGitHub <noreply@github.com>2024-11-20 17:37:57 +0000
commitf76323e9b295c15751e51e3443aa47a36bee8023 (patch)
tree4113c8cad473a33e0f746966e0cf087252fa1d7a /yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql
parent753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff)
parenta7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff)
downloadydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql')
-rw-r--r--yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql40
1 files changed, 40 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql b/yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql
new file mode 100644
index 0000000000..655c4940e1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/flatten_by/flatten_mode.sql
@@ -0,0 +1,40 @@
+/* postgres can not */
+USE plato;
+
+SELECT
+ *
+FROM (SELECT Just(1) AS x)
+FLATTEN OPTIONAL BY x;
+
+$lst = AsList(1,2,3);
+SELECT
+ *
+FROM (SELECT $lst AS x)
+FLATTEN LIST BY x ORDER BY x;
+
+SELECT
+ x
+FROM (SELECT Just($lst) AS x)
+FLATTEN LIST BY x ORDER BY x;
+
+SELECT
+ *
+FROM (SELECT Just($lst) AS x)
+FLATTEN OPTIONAL BY x ORDER BY x;
+
+$dct = AsDict(AsTuple(1,"foo"),AsTuple(2,"bar"),AsTuple(3,"baz"));
+
+SELECT
+ *
+FROM (SELECT $dct AS x)
+FLATTEN DICT BY x ORDER BY x;
+
+SELECT
+ x
+FROM (SELECT Just($dct) AS x)
+FLATTEN DICT BY x ORDER BY x;
+
+SELECT
+ ListSort(DictItems(x))
+FROM (SELECT Just($dct) AS x)
+FLATTEN OPTIONAL BY x;