-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Flink: If IcebergSink writeParallelism is not specified, defaults to the input source parallelism #13260
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
base: main
Are you sure you want to change the base?
Conversation
12447ac
to
e403b98
Compare
flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergSink.java
Outdated
Show resolved
Hide resolved
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java
Outdated
Show resolved
Hide resolved
…the input source parallelism
ba49b0f
to
08e3fab
Compare
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java
Outdated
Show resolved
Hide resolved
flink/v2.0/flink/src/test/java/org/apache/iceberg/flink/sink/TestIcebergSink.java
Outdated
Show resolved
Hide resolved
|
||
// since the sink write parallelism was null, it asserts that the default parallelism used was | ||
// the input source parallelism | ||
assertThat(sink.getTransformation().getParallelism()).isEqualTo(dataStream.getParallelism()); |
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.
sink has multi-stage DAG. does sink.getTransformation
get the writer operator? or writer parallelism is always the same as the transformation parallelism?
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.
Yes, I did a debugging and could confirm it.
.tableLoader(tableLoader) | ||
.tableSchema(SimpleDataUtil.FLINK_SCHEMA) | ||
.distributionMode(DistributionMode.NONE) | ||
.writeParallelism(parallelism) |
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 parallelism could be the same as the input stream parallelism. we need to set the parallelism to be differnt as the input stream parallelism
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.
the inputStream parallelism is always 1 and cannot easily be changed (it is a non-parallel source). So when the parallelism test template parameter is 2, the test is asserting that the writeParallelism is actually 2 (and not 1 as the parallelism of the inputSource)
Currently, if the writeParallelism is not specified, the IcebergSink will default to use the job parallelism.
Instead, we should default to the inputSource parallelism, to promote chaining.
This PR tracks that change, consequently bringing parity with the FlinkSink.
re: #12071 (comment)
cc: @stevenzwu @mxm @pvary @gyfora