File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 3030import org .apache .paimon .table .BucketMode ;
3131import org .apache .paimon .table .FileStoreTable ;
3232import org .apache .paimon .table .Table ;
33+ import org .apache .paimon .table .sink .ChannelComputer ;
3334
3435import org .apache .flink .api .common .functions .MapFunction ;
3536import org .apache .flink .streaming .api .datastream .DataStream ;
@@ -291,8 +292,14 @@ protected DataStreamSink<?> buildForFixedBucket(DataStream<InternalRow> input) {
291292 }
292293
293294 private DataStreamSink <?> buildPostponeBucketSink (DataStream <InternalRow > input ) {
294- DataStream <InternalRow > partitioned =
295- partition (input , new PostponeBucketChannelComputer (table .schema ()), parallelism );
295+ ChannelComputer <InternalRow > channelComputer ;
296+ if (!table .partitionKeys ().isEmpty ()
297+ && table .coreOptions ().partitionSinkStrategy () == PartitionSinkStrategy .HASH ) {
298+ channelComputer = new RowDataHashPartitionChannelComputer (table .schema ());
299+ } else {
300+ channelComputer = new PostponeBucketChannelComputer (table .schema ());
301+ }
302+ DataStream <InternalRow > partitioned = partition (input , channelComputer , parallelism );
296303 FixedBucketSink sink = new FixedBucketSink (table , overwritePartition , null );
297304 return sink .sinkFrom (partitioned );
298305 }
You can’t perform that action at this time.
0 commit comments