waynexia commented on code in PR #7382:
URL: https://github.com/apache/arrow-datafusion/pull/7382#discussion_r1304402606


##########
datafusion/substrait/tests/cases/roundtrip_logical_plan.rs:
##########
@@ -209,6 +209,23 @@ async fn aggregate_multiple_keys() -> Result<()> {
     roundtrip("SELECT a, c, avg(b) FROM data GROUP BY a, c").await
 }
 
+#[tokio::test]
+async fn aggregate_grouping_sets() -> Result<()> {
+    roundtrip(
+        "SELECT a, c, d, avg(b) FROM data GROUP BY GROUPING SETS ((a, c), (a), 
(d), ())",
+    )
+    .await
+}
+
+#[tokio::test]
+async fn aggregate_grouping_rollup() -> Result<()> {
+    assert_expected_plan(
+        "SELECT a, c, e, avg(b) FROM data GROUP BY ROLLUP (a, c, e)",
+        "Aggregate: groupBy=[[GROUPING SETS ((data.a, data.c, data.e), 
(data.a, data.c), (data.a), ())]], aggr=[[AVG(data.b)]]\

Review Comment:
   👍 



##########
datafusion/substrait/tests/cases/roundtrip_logical_plan.rs:
##########
@@ -209,6 +209,23 @@ async fn aggregate_multiple_keys() -> Result<()> {
     roundtrip("SELECT a, c, avg(b) FROM data GROUP BY a, c").await
 }
 
+#[tokio::test]
+async fn aggregate_grouping_sets() -> Result<()> {
+    roundtrip(
+        "SELECT a, c, d, avg(b) FROM data GROUP BY GROUPING SETS ((a, c), (a), 
(d), ())",
+    )
+    .await
+}
+
+#[tokio::test]
+async fn aggregate_grouping_rollup() -> Result<()> {
+    assert_expected_plan(
+        "SELECT a, c, e, avg(b) FROM data GROUP BY ROLLUP (a, c, e)",
+        "Aggregate: groupBy=[[GROUPING SETS ((data.a, data.c, data.e), 
(data.a, data.c), (data.a), ())]], aggr=[[AVG(data.b)]]\

Review Comment:
   👍 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to