Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21813#discussion_r203918259
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ---
    @@ -442,17 +442,35 @@ class Analyzer(
             child: LogicalPlan): LogicalPlan = {
           val gid = AttributeReference(VirtualColumn.groupingIdName, 
IntegerType, false)()
     
    +      // In case of ANSI-SQL compliant syntax for GROUPING SETS, 
groupByExprs is optional and
    +      // can be null. In such case, we derive the groupByExprs from the 
user supplied values for
    +      // grouping sets.
    +      val finalGroupByExpressions = if (groupByExprs == Nil) {
    +        selectedGroupByExprs.flatten.foldLeft(Seq.empty[Expression]) { 
(result, currentExpr) =>
    --- End diff --
    
    Can we have a test case for it too?


---

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

Reply via email to