szehon-ho commented on code in PR #51698:
URL: https://github.com/apache/spark/pull/51698#discussion_r2261732876


##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/SupportsRowLevelOperations.java:
##########
@@ -39,4 +40,23 @@ public interface SupportsRowLevelOperations extends Table {
    * @return the row-level operation builder
    */
   RowLevelOperationBuilder newRowLevelOperationBuilder(RowLevelOperationInfo 
info);
+
+
+  /**
+   * Calculate target table schema for MERGE INTO schema evolution.  Data 
source should take into
+   * account spark.sql.caseSensitive when determining if columns are new or 
existing.
+   * @param sourceTableSchema schema of the source table for MERGE INTO 
operation.
+   * @return new schema for the target table
+   */
+  default StructType mergeSchema(StructType sourceTableSchema) {
+    return CatalogV2Util.v2ColumnsToStructType(columns());
+  }
+
+  /**
+   * Update schema for MERGE INTO schema evolution.
+   * @param newSchema schema to apply to target table for MERGE INTO 
operation. This
+   *                          will be from the return value of #{@link 
#mergeSchema(StructType)}
+   */
+  default void updateSchema(StructType newSchema) {

Review Comment:
   changed to spark generating tableChanges and calling alterTable



-- 
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: reviews-unsubscr...@spark.apache.org

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


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

Reply via email to