gengliangwang commented on code in PR #42036:
URL: https://github.com/apache/spark/pull/42036#discussion_r1270216924
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CTESubstitution.scala:
##########
@@ -273,4 +297,21 @@ object CTESubstitution extends Rule[LogicalPlan] {
e.withNewPlan(apply(substituteCTE(e.plan, alwaysInline,
cteRelations)))
}
}
+ }
+
+ /**
+ * For commands which extend `CTEInChildren`, we should place the `WithCTE`
node on its
+ * children. There are two reasons:
+ * 1. Some rules will pattern match the root command nodes, and we should
keep command
+ * as the root node to not break them.
+ * 2. `Dataset` eagerly executes the commands inside a query plan. However,
the CTE
Review Comment:
Nit: Shall we have an example for the eager execution?
--
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]