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.
  • Loading branch information
LinMingQiang committed Dec 4, 2024
1 parent 812ef05 commit 632a57b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,15 @@ 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, the writerOperator's parallelism will be set to bucketNums if the bucketNums is less than inputOperator's parallelism.");
parallelism = bucketNums;
}
DataStream<InternalRow> partitioned =
partition(
input,
Expand Down

0 comments on commit 632a57b

Please sign in to comment.