Reo-LEI commented on a change in pull request #2863: URL: https://github.com/apache/iceberg/pull/2863#discussion_r704949371
########## File path: flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java ########## @@ -321,7 +339,27 @@ private String operatorName(String suffix) { equalityFieldIds.add(field.fieldId()); } } - IcebergStreamWriter<RowData> streamWriter = createStreamWriter(table, flinkRowType, equalityFieldIds); + + // Fallback to use upsert mode parsed from table properties if don't specify in job level. + boolean upsertMode = upsert || PropertyUtil.propertyAsBoolean(table.properties(), + UPSERT_MODE_ENABLE, UPSERT_MODE_ENABLE_DEFAULT); + + // Validate the equality fields and partition fields if we enable the upsert mode. + if (upsertMode) { + Preconditions.checkState(!overwrite, + "OVERWRITE mode shouldn't be enable when configuring to use UPSERT data stream."); Review comment: I have added a unittest to covery this, thanks for your reminder!:) @kbendick -- 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