Reo-LEI commented on a change in pull request #3827:
URL: https://github.com/apache/iceberg/pull/3827#discussion_r782761684



##########
File path: site/docs/flink.md
##########
@@ -522,6 +522,20 @@ FlinkSink.forRowData(input)
 env.execute("Test Iceberg DataStream");
 ```
 
+## Streaming upsert write
+
+Iceberg supports upsert based on the primary key when writing streaming data 
into v2 table format.
+
+```sql
+CREATE TABLE `hive_catalog`.`default`.`sample` (
+  `id`  INT UNIQUE COMMENT 'unique id',
+  `data` STRING NOT NULL,
+ PRIMARY KEY(`id`) NOT ENFORCED
+) with ('format-version'='2', 'write.upsert.enabled'='true');
+```
+!!! Note

Review comment:
       In UPSERT mode, if the table is partitioned, the partition fields should 
be a part of equality fields. I think this is important and should be mentioned 
in the docs. 
   
   
https://github.com/apache/iceberg/blob/e0ff71dfa8ffb54941fcc82ae127ab06f271331c/flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java#L378




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