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


##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/MetadataColumn.java:
##########
@@ -36,6 +36,45 @@
  */
 @Evolving
 public interface MetadataColumn {
+  /**
+   * Indicates whether a row-level operation should preserve the value of the 
metadata column
+   * for deleted rows. If set to true, the metadata value will be retained and 
passed back to
+   * the writer. If false, the metadata value will be replaced with {@code 
null}.
+   * <p>
+   * This flag applies only to row-level operations working with deltas of 
rows. Group-based
+   * operations handle deletes by discarding matching records.
+   *
+   * @since 4.0.0
+   */
+  String PRESERVE_ON_DELETE = "__preserve_on_delete";
+  boolean PRESERVE_ON_DELETE_DEFAULT = true;
+
+  /**
+   * Indicates whether a row-level operation should preserve the value of the 
metadata column
+   * for updated rows. If set to true, the metadata value will be retained and 
passed back to
+   * the writer. If false, the metadata value will be replaced with {@code 
null}.
+   * <p>
+   * This flag applies to both group-based and delta-based row-level 
operations.
+   *
+   * @since 4.0.0
+   */
+  String PRESERVE_ON_UPDATE = "__preserve_on_update";
+  boolean PRESERVE_ON_UPDATE_DEFAULT = true;
+
+  /**
+   * Indicates whether a row-level operation should preserve the value of the 
metadata column
+   * for inserts generated by splitting updated rows into deletes and inserts. 
If true,
+   * the metadata value will be retained and passed back to the writer. If 
false, the
+   * metadata value will be replaced with {@code null}.
+   * <p>
+   * This flag applies only to row-level operations working with deltas of 
rows. Group-based
+   * operations do not represent updates as deletes and inserts.
+   *
+   * @since 4.0.0
+   */
+  String PRESERVE_ON_INSERT_AS_UPDATE = "__preserve_on_insert_as_update";

Review Comment:
   Actually, let me reconsider the naming a bit more here. Please ignore 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: 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