-
Notifications
You must be signed in to change notification settings - Fork 3k
Flink: Rename upsert table property #3504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,8 +59,8 @@ | |
|
|
||
| import static org.apache.iceberg.TableProperties.DEFAULT_FILE_FORMAT; | ||
| import static org.apache.iceberg.TableProperties.DEFAULT_FILE_FORMAT_DEFAULT; | ||
| import static org.apache.iceberg.TableProperties.UPSERT_MODE_ENABLE; | ||
| import static org.apache.iceberg.TableProperties.UPSERT_MODE_ENABLE_DEFAULT; | ||
| import static org.apache.iceberg.TableProperties.UPSERT_ENABLED; | ||
| import static org.apache.iceberg.TableProperties.UPSERT_ENABLED_DEFAULT; | ||
| import static org.apache.iceberg.TableProperties.WRITE_DISTRIBUTION_MODE; | ||
| import static org.apache.iceberg.TableProperties.WRITE_DISTRIBUTION_MODE_DEFAULT; | ||
| import static org.apache.iceberg.TableProperties.WRITE_TARGET_FILE_SIZE_BYTES; | ||
|
|
@@ -222,11 +222,11 @@ public Builder writeParallelism(int newWriteParallelism) { | |
| * a subset of equality fields, otherwise the old row that located in partition-A could not be deleted by the | ||
| * new row that located in partition-B. | ||
| * | ||
| * @param enable indicate whether it should transform all INSERT/UPDATE_AFTER events to UPSERT. | ||
| * @param enabled indicate whether it should transform all INSERT/UPDATE_AFTER events to UPSERT. | ||
| * @return {@link Builder} to connect the iceberg table. | ||
| */ | ||
| public Builder upsert(boolean enable) { | ||
| this.upsert = enable; | ||
| public Builder upsert(boolean enabled) { | ||
| this.upsert = enabled; | ||
| return this; | ||
| } | ||
|
|
||
|
|
@@ -364,7 +364,7 @@ private SingleOutputStreamOperator<WriteResult> appendWriter(DataStream<RowData> | |
|
|
||
| // 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); | ||
| UPSERT_ENABLED, UPSERT_ENABLED_DEFAULT); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need a corresponding change for the job level check? The one that the variable
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you mean it's also good to name those variables to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed, @openinx. |
||
|
|
||
| // Validate the equality fields and partition fields if we enable the upsert mode. | ||
| if (upsertMode) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is a breaking change, should we allow both for at least one release?
Especially given that this could be set in a number of places such as:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have any released version since the PR got merged: #2863. I think it's OK to rename it to
enabled.I think it's my mistake because I did not notice that all the iceberg switch are named as
xxx.enabledbefore. Thanks for the fix before we have a release, so that we don't have to maintain this inconsistent name for at least one release.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, I think we can just rename it as it hasn't been released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that's great. If it hasn't been released then no worries. Retroactive +1.