-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Flink: Support writes to branches in FlinkSink #6660
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
b682cbe to
1ee27ed
Compare
|
moving this out of draft. Beyond the code wanted to discuss high level API design for branch writes using FlinkSink. In the current implementation we're using a FlinkWriteOption so it looks like this right now: As I implemented this though started to think we may just want to have a direct branch method on the FlinkSink builder itself. That seems more intuitive from an API perspective and is just easier to use. The API below seems better to me @stevenzwu @yyanyy @rdblue @jackye1995 @namrathamyske Let me know your thoughts here! |
|
Need to fix up the tests also |
6be254d to
9fe7b8b
Compare
Yeah. I also think an explicit |
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergFilesCommitter.java
Show resolved
Hide resolved
1ceaf7f to
7456b04
Compare
flink/v1.16/flink/src/test/java/org/apache/iceberg/flink/SimpleDataUtil.java
Show resolved
Hide resolved
I think this is more of a question about convention, I will leave to people who use Flink more often to have an opinion. To me use |
c1d0dd6 to
855fb9d
Compare
jackye1995
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.
looks good to me, thanks for addressing the comments!
|
Thanks for the reviews @stevenzwu @jackye1995 ! |
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/sink/FlinkSink.java
Show resolved
Hide resolved
|
Thanks for the PR @amogh-jahagirdar! Also, do we have this feature in FlinkSource? |
Thanks for the review @pvary ! Not yet, but I'm working on a PR for it, will publish when it's ready . |
0461c9a to
35e2fca
Compare
flink/v1.16/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSinkV2.java
Outdated
Show resolved
Hide resolved
f9a8f60 to
ca5ddd0
Compare
A long time ago, I raised a related #5029 to do this, if you can, can you take a look? |
Thanks, marking that as a part of the milestone! |
flink/v1.16/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSinkBranch.java
Outdated
Show resolved
Hide resolved
flink/v1.16/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSinkBranch.java
Show resolved
Hide resolved
flink/v1.16/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSinkBranch.java
Show resolved
Hide resolved
flink/v1.16/flink/src/test/java/org/apache/iceberg/flink/sink/TestFlinkIcebergSinkBranch.java
Outdated
Show resolved
Hide resolved
86573fb to
9a78a9d
Compare
9a78a9d to
1bfe2b3
Compare
| new Object[] {"parquet", 2}, | ||
| new Object[] {"orc", 1}, | ||
| new Object[] {"orc", 2} | ||
| new Object[] {"avro", 1, "main"}, |
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: can we use SnapshotRef.MAIN_BRANCH for all the places we have "main" hard-coded?
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.
Also similar to the comment in Spark https://github.com/apache/iceberg/pull/6651/files#r1101939155, can we reduce the number of combinations here?
|
thanks @amogh-jahagirdar for the contribution and @jackye1995 and @hililiwei for review. |
|
Thanks for the reviews! @stevenzwu @jackye1995 @hililiwei |
This change adds support to write to branches in Flink Sink via a FlinkWriteOption "branch"