aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/aggregate/compact_distinct.sql
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-12-12 15:00:43 +0000
committerGitHub <noreply@github.com>2024-12-12 15:00:43 +0000
commit42701242eaf5be980cb935631586d0e90b82641c (patch)
tree6dbf5fcd37d3c16591e196c4a69d166e3ab3a398 /yql/essentials/tests/sql/suites/aggregate/compact_distinct.sql
parent7f5a9f394dbd9ac290cabbb7977538656b3a541e (diff)
parentf7c04b5876af3d16849ab5e3079c0eabbd4e3a00 (diff)
downloadydb-42701242eaf5be980cb935631586d0e90b82641c.tar.gz
Merge pull request #12554 from vitalyisaev2/YQ-3839.with_rightlib.3
Import from Arcadia + YDB FQ: turning gateways_config.proto into a file without external dependencies
Diffstat (limited to 'yql/essentials/tests/sql/suites/aggregate/compact_distinct.sql')
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/compact_distinct.sql14
1 files changed, 14 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/aggregate/compact_distinct.sql b/yql/essentials/tests/sql/suites/aggregate/compact_distinct.sql
new file mode 100644
index 0000000000..4176ad60aa
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/compact_distinct.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+pragma AnsiOptionalAs;
+pragma yt.CompactForDistinct;
+
+$x = (
+ SELECT key, AVG(DISTINCT Cast(subkey as float)) s FROM InputB GROUP BY key
+);
+
+$y = (
+ SELECT key, SUM(Cast(subkey as float)) s FROM InputC GROUP BY key
+);
+
+SELECT x.key, x.s AS s1, y.s AS s2 FROM $x x FULL OUTER JOIN $y y ON x.key = y.key;