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



##########
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:
       This needs to be discussed and I am open to alternatives. With the 
current change, the API seems a bit confusing but maybe we can play with names 
to make the purpose clear. In short, this method is to distinguish inserts from 
updates. In case of MERGE, we order updates by _spec_id, _partition, _file, 
_pos and updated records can be out of order if we change the sort key or 
partition columns. For inserts, the metadata columns are null so we have no 
problems ordering inserts.




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