viirya commented on code in PR #37348:
URL: https://github.com/apache/spark/pull/37348#discussion_r1059271762
##########
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:
Hmm, we intend to replace some attributes with its nested fields if they are
accessed on top of the plan. So we can prune unused fields later.
If we keep original outputs, I think pruning will not work actually.
--
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]