cloud-fan commented on code in PR #43813:
URL: https://github.com/apache/spark/pull/43813#discussion_r1398685261


##########
sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala:
##########
@@ -1825,6 +1825,33 @@ class Dataset[T] private[sql](
     RelationalGroupedDataset(toDF(), cols.map(_.expr), 
RelationalGroupedDataset.CubeType)
   }
 
+  /**
+   * Create multi-dimensional aggregation for the current Dataset using the 
specified grouping sets,
+   * so we can run aggregation on them.
+   * See [[RelationalGroupedDataset]] for all the available aggregate 
functions.
+   *
+   * {{{
+   *   // Compute the average for all numeric columns group by specific 
grouping sets.
+   *   ds.groupingSets(Seq(Seq($"department", $"group"),Seq()),$"department", 
$"group").avg()

Review Comment:
   The SQL syntax is `GROUP BY ... GROUPING SETS (...)`, shall we put grouping 
cols as the first parameter?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to