You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/02/04 17:56:27 UTC

[GitHub] [iceberg] aokolnychyi commented on a change in pull request #3984: Spark 3.2: Implement merge-on-read UPDATE

aokolnychyi commented on a change in pull request #3984:
URL: https://github.com/apache/iceberg/pull/3984#discussion_r799690563



##########
File path: core/src/main/java/org/apache/iceberg/io/PositionDeltaWriter.java
##########
@@ -41,6 +41,21 @@
    */
   void insert(T row, PartitionSpec spec, StructLike partition);
 
+  /**
+   * Inserts a new version of an existing row to the provided spec/partition.
+   * <p>
+   * This method allows writers to distinguish new and updated records. The caller must separately
+   * invoke {@link #delete(CharSequence, long, PartitionSpec, StructLike)} for the original
+   * row position that is being updated.
+   *
+   * @param row a new version of an existing row
+   * @param spec a new partition spec
+   * @param partition a new partition or null if the spec is unpartitioned
+   */
+  default void update(T row, PartitionSpec spec, StructLike partition) {

Review comment:
       @szehon-ho, I thought about it but the original record may be in one spec/partition and the new record may be written to another one. As a result, we would need to have path, pos, row, oldSpec, oldPartition, newSpec, newPartition, which makes it a rather long list of arguments. I am happy to reconsider if folks prefer that API instead of this one.
   
   @rdblue, correct, your last comment is spot on.




-- 
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: issues-unsubscribe@iceberg.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org