maropu commented on a change in pull request #30212:
URL: https://github.com/apache/spark/pull/30212#discussion_r531409067



##########
File path: sql/core/src/test/resources/sql-tests/inputs/group-analytics.sql
##########
@@ -18,9 +18,13 @@ AS courseSales(course, year, earnings);
 
 -- ROLLUP
 SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, 
year) ORDER BY course, year;
+SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP (course, 
year) ORDER BY course, year;
+SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, 
year, (course, year)) ORDER BY course, year;
 
 -- CUBE
 SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, 
year) ORDER BY course, year;
+SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE (course, 
year) ORDER BY course, year;
+SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, 
year, (course, year)) ORDER BY course, year;

Review comment:
       Could you add more test patterns? For example,
   ```
   scala> sql("select a, b, sum(c) from t group by cube ((a, b), ())").show()
   +---+---+------+
   |  a|  b|sum(c)|
   +---+---+------+
   +---+---+------+
   
   postgres=# select a, b, sum(c) from t group by cube ((a, b), ());
   2020-11-27 15:43:52.365 JST [23118] ERROR:  syntax error at or near ")" at 
character 52
   2020-11-27 15:43:52.365 JST [23118] STATEMENT:  select a, b, sum(c) from t 
group by cube ((a, b), ());
   ERROR:  syntax error at or near ")"
   LINE 1: select a, b, sum(c) from t group by cube ((a, b), ());
   ```




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to