liucao-dd commented on code in PR #56705:
URL: https://github.com/apache/spark/pull/56705#discussion_r3476243198


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala:
##########
@@ -1166,6 +1170,44 @@ case class MergeIntoTable(
   }
 }
 
+/**
+ * The logical plan of the `INSERT INTO t REPLACE USING (cols) <query>` 
command, resolved from
+ * [[InsertIntoStatement]] when its replace criteria is an 
[[InsertReplaceUsing]].
+ *
+ * Scoped replace deletes every target row whose scope-column tuple appears in 
the source and
+ * appends all source rows, including duplicates that share the same scope 
tuple. The command uses
+ * [[RowLevelOperation.Command.REPLACE]] so connectors can distinguish this 
scope-level replacement
+ * from per-row MERGE semantics.
+ *
+ * @param targetTable the target relation to replace rows in
+ * @param scopeColumns unqualified target column names whose values define a 
replace scope tuple
+ * @param query        the source query, already aligned to the target table 
output
+ */
+case class ReplaceUsingTable(
+    targetTable: LogicalPlan,
+    scopeColumns: Seq[String],
+    query: LogicalPlan)
+    extends BinaryCommand with SupportsSubquery with TransactionalWrite {
+
+  override def table: LogicalPlan = EliminateSubqueryAliases(targetTable)
+
+  lazy val rewritable: Boolean = {

Review Comment:
   good catch, was internally debating about it and forgot to delete it - 
Removing it and will just let the new SupportsRowLevelReplace take care of the 
gating and keep things simple for now



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