aokolnychyi commented on code in PR #55586:
URL: https://github.com/apache/spark/pull/55586#discussion_r3220579381


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala:
##########
@@ -194,6 +194,26 @@ object AppendData {
   }
 }
 
+/**
+ * Append data to an existing table as the result of an insert-only MERGE 
rewrite.
+ *
+ * Functionally equivalent to [[AppendData]] but distinguishes the row-level 
MERGE rewrite path.
+ */
+case class InsertOnlyMerge(
+    table: NamedRelation,
+    query: LogicalPlan,
+    write: Option[Write] = None,
+    analyzedQuery: Option[LogicalPlan] = None) extends V2WriteCommand with 
TransactionalWrite {
+  override val isByName: Boolean = false
+  override val withSchemaEvolution: Boolean = false
+  override val writePrivileges: Set[TableWritePrivilege] = 
Set(TableWritePrivilege.INSERT)
+  override def withNewQuery(newQuery: LogicalPlan): InsertOnlyMerge = 
copy(query = newQuery)
+  override def withNewTable(newTable: NamedRelation): InsertOnlyMerge = 
copy(table = newTable)
+  override def storeAnalyzedQuery(): Command = copy(analyzedQuery = 
Some(query))

Review Comment:
   Do we support v1 fallback for this command? I feel this is more like 
`ReplaceData` / `WriteDelta` nodes.



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