-
Notifications
You must be signed in to change notification settings - Fork 3k
Flink: Support write options in FlinkSink builder #3998
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
Conversation
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
|
initially, I misread the intention was to do partition overwrite for commit Can we update the PR title to sth like "Support override write configuration on top of table properties in FlinkSink builder"? |
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
db3b8b0 to
36e434b
Compare
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
rdblue
left a comment
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.
This looks close, but I think that this changes behavior when the table is set through a table loader rather than directly. This should also have tests before we can merge it. Thanks for working on this, @hililiwei!
3f29f63 to
2ca5733
Compare
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSink.java
Outdated
Show resolved
Hide resolved
68151c5 to
5cc1907
Compare
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSink.java
Outdated
Show resolved
Hide resolved
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSink.java
Outdated
Show resolved
Hide resolved
d4e671b to
d56f406
Compare
docs/flink/flink-getting-started.md
Outdated
| | write-format | Table write.format.default | File format to use for this write operation; parquet, avro, or orc | | ||
| | target-file-size-bytes | As per table property | Overrides this table's write.target-file-size-bytes | | ||
| | upsert-enabled | Table write.upsert.enabled | Overrides this table's write.upsert.enabled | | ||
| | overwrite | false | Overwrite the table's data | |
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.
Can we enable both upsert-enabled and overwrite? If not, should we need some doc?
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.
nit: shall we use overwrite-enabled to keep the name consistent?
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.
good. done. we cann't enable both upsert-enabled and overwrite
| return confParser.booleanConf() | ||
| .option(FlinkWriteOptions.OVERWRITE_MODE.key()) | ||
| .flinkConfig(FlinkWriteOptions.OVERWRITE_MODE) | ||
| .defaultValue(false) |
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.
Should we use OVERWRITE_MODE_DEFAULT?
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.
done
44f3081 to
8739060
Compare
|
@rdblue, Could you please take another look? |
chenjunjiedada
left a comment
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.
LGTM
docs/flink-getting-started.md
Outdated
|
|
||
| | Flink option | Default | Description | | ||
| |------------------------| -------------------------- |------------------------------------------------------------------------------------------------------------| | ||
| | write-file-format | Table write.format.default | File format to use for this write operation; parquet, avro, or orc | |
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.
Can you use the same options that Spark uses? That way people don't have to remember different names.
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.
Done.
|
Thanks, @hililiwei! This looks good now. I'll merge. |
|
Thanks all for the reviews. I will port it to all the another versions. |
optimize optimize
Supports overwriting table configuration, such upsert \ overwirte\ file-format, when creating Flink sink.。