AMashenkov commented on code in PR #2312:
URL: https://github.com/apache/ignite-3/pull/2312#discussion_r1276107755


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItAggregatesTest.java:
##########
@@ -485,24 +496,90 @@ public void checkEmptyTable(String[] rules) {
         }
     }
 
+    @ParameterizedTest
+    @MethodSource("rulesForGroupingSets")
+    public void testGroupingSets(String[] rules) {
+        try {
+            sql("CREATE TABLE test1 (id INTEGER PRIMARY KEY, str_col VARCHAR, 
int_col INTEGER);");
+            sql("INSERT INTO test1 VALUES (1, 's1', 10)");
+            sql("INSERT INTO test1 VALUES (2, 's1', 20)");
+            sql("INSERT INTO test1 VALUES (3, 's2', 10)");
+            sql("INSERT INTO test1 VALUES (4, 's3', 40)");
+
+            assertQuery("SELECT str_col, SUM(int_col), COUNT(str_col) FROM 
test1 GROUP BY GROUPING SETS "
+                    + "( (str_col, int_col), (str_col), (int_col), () ) HAVING 
SUM(int_col) > 0")
+                    .disableRules(rules)
+                    .returns(null, 80L, 4L)
+                    .returns("s1", 10L, 1L)
+                    .returns("s3", 40L, 1L)
+                    .returns("s1", 20L, 1L)
+                    .returns("s2", 10L, 1L)
+                    .returns("s2", 10L, 1L)
+                    .returns("s3", 40L, 1L)
+                    .returns("s1", 30L, 2L)
+                    .returns(null, 40L, 1L)
+                    .returns(null, 20L, 2L)
+                    .returns(null, 20L, 1L)
+                    .check();
+
+        } finally {
+            sql("DROP TABLE test1");

Review Comment:
   I think it would be ok to fix only changes and new tests.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to