Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/22582#discussion_r221413500
--- 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 --
Good catch!
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]