This is an automated email from the ASF dual-hosted git repository.
zstan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 42d717ed93 IGNITE-18670: Sql. It is possible to reference aliases in
GROUP BY clause. (#2545)
42d717ed93 is described below
commit 42d717ed937fa84707dd724dbf147f089f20d973
Author: Max Zhuravkov <[email protected]>
AuthorDate: Thu Sep 7 08:40:05 2023 +0300
IGNITE-18670: Sql. It is possible to reference aliases in GROUP BY clause.
(#2545)
---
.../sql/aggregate/group/test_group_by.test | 17 +++++++++++------
.../sql/aggregate/group/test_group_by.test_ignore | 16 +++++++++++-----
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git
a/modules/runner/src/integrationTest/sql/aggregate/group/test_group_by.test
b/modules/runner/src/integrationTest/sql/aggregate/group/test_group_by.test
index 6cdaf67021..4f48454bf9 100644
--- a/modules/runner/src/integrationTest/sql/aggregate/group/test_group_by.test
+++ b/modules/runner/src/integrationTest/sql/aggregate/group/test_group_by.test
@@ -131,12 +131,17 @@ NULL NULL
2 2.000000
3 3.000000
-# aliases can only be referenced in the GROUP BY as the root column:
operations not allowed
-# CONTROVERSIAL: this query DOES work in SQLite
-skipif ignite3
-# https://issues.apache.org/jira/browse/IGNITE-18670
-statement error
-SELECT 1 AS k, SUM(i) FROM integers GROUP BY k+1 ORDER BY 2;
+# aliases can be referenced in group by <columns> clause.
+query II
+SELECT 1 AS k, SUM(i) FROM integers GROUP BY k+1 ORDER BY 2
+----
+1 6
+
+# aliases can be referenced in group by <grouping sets> clause.
+query II
+SELECT 1 AS k, SUM(i) FROM integers GROUP BY GROUPING SETS ((k+1)) ORDER BY 2
+----
+1 6
# group by column refs should be recognized, even if one uses an explicit
table specifier and the other does not
query II
diff --git
a/modules/runner/src/integrationTest/sql/aggregate/group/test_group_by.test_ignore
b/modules/runner/src/integrationTest/sql/aggregate/group/test_group_by.test_ignore
index a1a6325f52..f042382bb9 100644
---
a/modules/runner/src/integrationTest/sql/aggregate/group/test_group_by.test_ignore
+++
b/modules/runner/src/integrationTest/sql/aggregate/group/test_group_by.test_ignore
@@ -169,11 +169,17 @@ NULL NULL NULL
2 0 2.000000
3 1 3.000000
-# aliases can only be referenced in the GROUP BY as the root column:
operations not allowed
-# CONTROVERSIAL: this query DOES work in SQLite
-statement error
-# https://issues.apache.org/jira/browse/IGNITE-18670
-SELECT 1 AS k, SUM(i) FROM integers GROUP BY k+1 ORDER BY 2;
+# aliases can be referenced in group by <columns> clause.
+query II
+SELECT 1 AS k, SUM(i) FROM integers GROUP BY k+1 ORDER BY 2
+----
+1 6
+
+# aliases can be referenced in group by <grouping sets> clause.
+query II
+SELECT 1 AS k, SUM(i) FROM integers GROUP BY GROUPING SETS ((k+1)) ORDER BY 2
+----
+1 6
# group by column refs should be recognized, even if one uses an explicit
table specifier and the other does not
query II