summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites
diff options
context:
space:
mode:
authorvitya-smirnov <[email protected]>2025-07-15 17:01:51 +0300
committervitya-smirnov <[email protected]>2025-07-15 17:19:51 +0300
commit64137fb0cbe9afe92dca8efc335ef9ff16b78926 (patch)
tree1f35ca0b330569f9725b3cfc2971a894b65b25f7 /yql/essentials/tests/sql/suites
parent6fb5119e5d0aee18cf78fb28d7f71c9539cca6dc (diff)
YQL-20171: Fix aggregation joining key
There was a bug with a aggregation deduplication by a column at the translator. For a single column the system joining all aggregations using the generic key. The generic key was just a column name without source name what leads to collision when aggregating multiple different sources with same column names. This patch fixes the generic key by adding a data source name there. Also tests are added. commit_hash:1c0a9da512f68c58d2830e096de76b769b733cb2
Diffstat (limited to 'yql/essentials/tests/sql/suites')
-rw-r--r--yql/essentials/tests/sql/suites/aggregate/yql-20171.sql10
1 files changed, 10 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/aggregate/yql-20171.sql b/yql/essentials/tests/sql/suites/aggregate/yql-20171.sql
new file mode 100644
index 00000000000..674b6454018
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/aggregate/yql-20171.sql
@@ -0,0 +1,10 @@
+SELECT Percentile(a.x, 0.50), Percentile(a.x, 0.75), Percentile(a.x, 1.00)
+FROM (VALUES (1), (2), (3), (4), (5)) AS a(x);
+
+SELECT Median(a.x), Median(b.y)
+FROM (SELECT 1 AS x) AS a
+JOIN (SELECT 10 AS y) AS b ON a.x == (b.y / 10);
+
+SELECT Median(a.x), Median(b.x)
+FROM (SELECT 1 AS x) AS a
+JOIN (SELECT 10 AS x) AS b ON a.x == (b.x / 10);