stevenzwu commented on code in PR #5380:
URL: https://github.com/apache/iceberg/pull/5380#discussion_r944074625
##########
docs/flink-getting-started.md:
##########
@@ -634,6 +634,26 @@ FlinkSink.forRowData(input)
env.execute("Test Iceberg DataStream");
```
+## UPSERT mode
+
+Iceberg supports `UPSERT` based on the primary key when writing data into v2
table format.
+
+Enable the `UPSERT` mode on a table by adding the `write.upsert.enabled`
configuration. All writing will be in `UPSERT` mode unless you overwrite it
when building the writer:
+
+```
+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');
+```
+
+Enabling `UPSERT` mode using `upsert-enabled` in the [write options](#Write
options) provides more flexibility than when creating a table. Note that you
still need to use v2 table format and specify the primary key when creating the
table.
Review Comment:
this might be a little more accurate
```
provides more flexibility than when creating a table
```
--->
```
provides more flexibility than a table level config.
```
--
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]