rdblue commented on a change in pull request #35395:
URL: https://github.com/apache/spark/pull/35395#discussion_r810701107



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala
##########
@@ -388,3 +391,62 @@ object ExtractSingleColumnNullAwareAntiJoin extends 
JoinSelectionHelper with Pre
     case _ => None
   }
 }
+
+/**
+ * An extractor for operations such as DELETE and MERGE that require rewriting 
data.
+ *
+ * This class extracts the following entities:
+ *  - the row-level command (such as [[DeleteFromTable]]);
+ *  - the read relation in the rewrite plan that can be either 
[[DataSourceV2Relation]] or
+ *  [[DataSourceV2ScanRelation]] depending on whether the planning has already 
happened;
+ *  - the current rewrite plan.

Review comment:
       It would be good to mention why this always finds the read relation 
rather than constructing the `RowLevelCommand` with a hard reference to it. My 
understanding is that it may be changed by the optimizer. It could be removed 
based on the condition and there may be more than one depending on the planning 
for UPDATE queries. Is that right?




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