Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/12496#discussion_r60282121
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicOperators.scala
---
@@ -516,7 +516,10 @@ private[sql] object Expand {
// groupingId is the last output, here we use the bit mask as the
concrete value for it.
} :+ Literal.create(bitmask, IntegerType)
}
- val output = child.output ++ groupByAttrs :+ gid
+
+ // the `groupByAttrs` has different meaning in `Expand.output`, it
could be the original
+ // grouping expression or null, so here we create new instance of it.
+ val output = child.output ++ groupByAttrs.map(_.newInstance) :+ gid
Expand(projections, output, Project(child.output ++ groupByAliases,
child))
--- End diff --
Do we still need this Project?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]