Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/22582#discussion_r221413483 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala --- @@ -556,7 +556,7 @@ class Analyzer( // Group-by expressions coming from SQL are implicit and need to be deduced. val groupByExprs = groupByExprsOpt.getOrElse { val pivotColAndAggRefs = - (pivotColumn.references ++ aggregates.flatMap(_.references)).toSet + aggregates.map(_.references).foldLeft(pivotColumn.references)(_ ++ _) --- End diff -- `pivotColumn.references ++ AttributeSet(aggregates)`
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org