zhengruifeng commented on code in PR #42040:
URL: https://github.com/apache/spark/pull/42040#discussion_r1265157852


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -3151,9 +3151,16 @@ class Analyzer(override val catalogManager: 
CatalogManager) extends RuleExecutor
         // Add Window operators.
         val withWindow = addWindow(windowExpressions, withProject)
 
+        val planId = p.getTagValue(LogicalPlan.PLAN_ID_TAG)
+
         // Finally, generate output columns according to the original 
projectList.
         val finalProjectList = projectList.map(_.toAttribute)
-        Project(finalProjectList, withWindow)
+        val newProject = Project(finalProjectList, withWindow)
+
+        // retain the plan id used in Spark Connect
+        planId.foreach(newProject.setTagValue(LogicalPlan.PLAN_ID_TAG, _))

Review Comment:
   this is to fix example 2.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala:
##########
@@ -290,6 +292,11 @@ abstract class TypeCoercionBase {
             s.copy(children = newChildren) -> attrMapping
           }
       }
+
+      // retain the plan id used in Spark Connect
+      planId.foreach(newPlan.setTagValue(LogicalPlan.PLAN_ID_TAG, _))

Review Comment:
   this is to fix example 1



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