You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/05 16:09:19 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #32041: [SPARK-34701][SQL] Introduce CommandWithAnalyzedChildren for a command to have its children only analyzed but not optimized

cloud-fan commented on a change in pull request #32041:
URL: https://github.com/apache/spark/pull/32041#discussion_r607174623



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/Command.scala
##########
@@ -37,3 +37,9 @@ trait Command extends LogicalPlan {
 trait LeafCommand extends Command with LeafLike[LogicalPlan]
 trait UnaryCommand extends Command with UnaryLike[LogicalPlan]
 trait BinaryCommand extends Command with BinaryLike[LogicalPlan]
+
+trait CommandWithAnalyzedChildren extends Command {
+  def childrenToAnalyze: Seq[LogicalPlan] = Nil
+
+  override final def children: Seq[LogicalPlan] = childrenToAnalyze.filter(!_.analyzed)

Review comment:
       This is a bit risky. Some analyzer rules may want to transform the child even if it's analyzed.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org