peterxcli commented on code in PR #5483:
URL: https://github.com/apache/datafusion-comet/pull/5483#discussion_r3873218484


##########
spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala:
##########
@@ -646,6 +646,15 @@ case class CometExecRule(session: SparkSession)
 
       // Set up logical links
       newPlan = newPlan.transform {
+        case op: CometExec
+            if op
+              .getTagValue(SparkPlan.LOGICAL_PLAN_TAG)
+              .exists(_.isInstanceOf[LogicalQueryStage]) =>
+          // AQE replanning reuses this physical root and links it to the 
current logical stage.
+          // originalPlan can still point to a subtree hidden inside that 
logical leaf, which
+          // AQE cannot replace in the current logical plan. Only preserve a 
direct stage link,
+          // not a link inherited from an ancestor.

Review Comment:
   is it possible to link some spark code snippet here with version tag to show 
why this case is added? so readers can understand these comment with more 
context



-- 
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]

Reply via email to