viirya commented on code in PR #37348:
URL: https://github.com/apache/spark/pull/37348#discussion_r1059272165
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/NestedColumnAliasing.scala:
##########
@@ -184,9 +184,20 @@ object NestedColumnAliasing {
plan: LogicalPlan,
nestedFieldToAlias: Map[Expression, Alias],
attrToAliases: AttributeMap[Seq[Alias]]): LogicalPlan = {
- plan.withNewChildren(plan.children.map { plan =>
- Project(plan.output.flatMap(a => attrToAliases.getOrElse(a, Seq(a))),
plan)
- }).transformExpressions {
+ val newChildPlan = plan match {
+ case g: Generate =>
+ g.withNewChildren(g.children.map { childPlan =>
+ val origOutput = childPlan.output
+ val fromAlias = childPlan.output.flatMap(a =>
attrToAliases.getOrElse(a, Nil))
Review Comment:
We may need to add a pruning test case to make sure pruning still works.
--
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]