cloud-fan commented on a change in pull request #33442:
URL: https://github.com/apache/spark/pull/33442#discussion_r673677898
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/RemoveRedundantProjects.scala
##########
@@ -49,7 +49,11 @@ object RemoveRedundantProjects extends Rule[SparkPlan] {
plan match {
case p @ ProjectExec(_, child) =>
if (isRedundant(p, child, requireOrdering) && canRemove(p, child)) {
- removeProject(child, requireOrdering)
+ val newPlan = removeProject(child, requireOrdering)
+ // The `newPlan` should retain the logical plan link already. We
call `setLogicalLink`
+ // here to make sure the `newPlan` sets the `LOGICAL_PLAN_TAG` tag.
+ newPlan.setLogicalLink(child.logicalLink.get)
+ newPlan
Review comment:
> Do you mean it has LOGICAL_PLAN_INHERITED_TAG but doesn't have
LOGICAL_PLAN_TAG?
Yes. `LOGICAL_PLAN_TAG` is kind of stronger than logical plan link (which
means either LOGICAL_PLAN_TAG or LOGICAL_PLAN_INHERITED_TAG is set).
--
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]