Skip to content

Commit

Permalink
[flink] Optimizing parallelism for fixed bucekt and non-partitioned t…
Browse files Browse the repository at this point in the history
…able (apache#4643)
  • Loading branch information
LinMingQiang authored Dec 6, 2024
1 parent 3186788 commit 8484bb4
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,16 @@ protected DataStreamSink<?> buildDynamicBucketSink(
}

protected DataStreamSink<?> buildForFixedBucket(DataStream<InternalRow> input) {
int bucketNums = table.bucketSpec().getNumBuckets();
if (parallelism == null
&& bucketNums < input.getParallelism()
&& table.partitionKeys().isEmpty()) {
// For non-partitioned table, if the bucketNums is less than job parallelism.
LOG.warn(
"For non-partitioned table, if bucketNums is less than the parallelism of inputOperator,"
+ " then the parallelism of writerOperator will be set to bucketNums.");
parallelism = bucketNums;
}
DataStream<InternalRow> partitioned =
partition(
input,
Expand Down

0 comments on commit 8484bb4

Please sign in to comment.