vladimirg-db commented on code in PR #46209:
URL: https://github.com/apache/spark/pull/46209#discussion_r1579933358
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/Command.scala:
##########
@@ -63,3 +63,14 @@ trait AnalysisOnlyCommand extends Command {
// on the `AnalysisContext`
def markAsAnalyzed(analysisContext: AnalysisContext): LogicalPlan
}
+
+/**
+ * A logical node that does not expose its sub-nodes as children, but rather
supervises them
+ * in an implementation-defined manner.
+ */
+trait SupervisingCommand extends LeafCommand {
+ /**
+ * Transform its supervised plan using `transformer` and returns a copy of
`SupervisingCommand`
+ */
+ def withTransformedSupervisedPlan(transformer: (LogicalPlan) =>
LogicalPlan): LogicalPlan
Review Comment:
This can be rewritten as two methods:
```scala
def supervisedPlan: LogicalPlan
def withNewSupervisedPlan(newPlan: LogicalPlan): LogicalPlan
```
But IMO the current impl is more concise
--
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]