tscottcoombes1 commented on code in PR #1534:
URL: https://github.com/apache/iceberg-python/pull/1534#discussion_r1937316058


##########
pyiceberg/table/__init__.py:
##########
@@ -1064,6 +1064,119 @@ def name_mapping(self) -> Optional[NameMapping]:
         """Return the table's field-id NameMapping."""
         return self.metadata.name_mapping()
 
+    def merge_rows(self, df: pa.Table, join_cols: list
+                   , when_matched_update_all: bool = True

Review Comment:
   can I suggest that the `when_matched` and `when_not_matched` accepts some 
enum:
   ```
   class DMLCommand(Enum):
       NONE = 0
       INSERT = 1
       UPDATE = 2
   ```
   then we can extend the merge functionality to support deletes in the future.
   My use case would be handling CDC streams into iceberg. 
   ```
   MERGE INTO this USING that
   ON this.id = that.id
   WHEN MATCHED AND op = 'D' THEN DELETE ...
   WHEN MATCHED THEN UPDATE ... 
   WHEN NOT MATCHED AND op != 'D' THEN INSERT ...
    ```
    
    btw thanks for doing this PR ❤️ 



-- 
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-unsubscr...@iceberg.apache.org

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


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

Reply via email to