You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "yuzelin (via GitHub)" <gi...@apache.org> on 2025/10/23 07:08:21 UTC
[PR] [postpone][flink] Postpone bucket table supports to batch write real bucket [paimon]
yuzelin opened a new pull request, #6460:
URL: https://github.com/apache/paimon/pull/6460
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
<!-- Linking this pull request to the issue -->
Linked issue: close #xxx
<!-- What is the purpose of the change -->
### Tests
<!-- List UT and IT cases to verify this change -->
### API and Format
<!-- Does this change affect API or storage format -->
### Documentation
<!-- Does this change introduce a new feature -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write fixed bucket [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6460:
URL: https://github.com/apache/paimon/pull/6460#discussion_r2473961783
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/RowDataStoreWriteOperator.java:
##########
@@ -96,6 +105,7 @@ protected boolean containLogSystem() {
public void open() throws Exception {
super.open();
+ tryChangeBucketNumber();
Review Comment:
Can you implement this in a new `PostponeWriteOperatorFactory`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write fixed bucket [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #6460:
URL: https://github.com/apache/paimon/pull/6460
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write real bucket [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6460:
URL: https://github.com/apache/paimon/pull/6460#discussion_r2458489129
##########
docs/layouts/shortcodes/generated/core_configuration.html:
##########
@@ -923,6 +923,12 @@
<td>String</td>
<td>You can specify a pattern to get a timestamp from partitions. The formatter pattern is defined by 'partition.timestamp-formatter'.<ul><li>By default, read from the first field.</li><li>If the timestamp in the partition is a single field called 'dt', you can use '$dt'.</li><li>If it is spread across multiple fields for year, month, day, and hour, you can use '$year-$month-$day $hour:00:00'.</li><li>If the timestamp is in fields dt and hour, you can use '$dt $hour:00:00'.</li></ul></td>
</tr>
+ <tr>
+ <td><h5>postpone.batch-write-real-bucket</h5></td>
Review Comment:
postpone.batch-write-fixed-bucket
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write fixed bucket [paimon]
Posted by "yuzelin (via GitHub)" <gi...@apache.org>.
yuzelin commented on code in PR #6460:
URL: https://github.com/apache/paimon/pull/6460#discussion_r2478047079
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/FlinkSinkBuilder.java:
##########
@@ -282,26 +340,22 @@ protected DataStreamSink<?> buildForFixedBucket(DataStream<InternalRow> input) {
+ " then the parallelism of writerOperator will be set to bucketNums.");
parallelism = bucketNums;
}
- DataStream<InternalRow> partitioned =
- partition(
- input,
- new RowDataChannelComputer(table.schema(), logSinkFunction != null),
- parallelism);
- FixedBucketSink sink = new FixedBucketSink(table, overwritePartition, logSinkFunction);
- return sink.sinkFrom(partitioned);
}
- private DataStreamSink<?> buildPostponeBucketSink(DataStream<InternalRow> input) {
- ChannelComputer<InternalRow> channelComputer;
- if (!table.partitionKeys().isEmpty()
- && table.coreOptions().partitionSinkStrategy() == PartitionSinkStrategy.HASH) {
- channelComputer = new RowDataHashPartitionChannelComputer(table.schema());
+ @Nullable
+ private Integer getPostponeFixedBucketNumber() {
+ // If data exists, use the current bucket number; otherwise, use sink.parallelism if set. If
+ // neither is set, use Flink's parallelism (get at runtime), but here we should use a
+ // default number.
+ List<SimpleFileEntry> simpleFileEntries =
+ table.store().newScan().onlyReadRealBuckets().readSimpleEntries();
Review Comment:
Add `testWriteFixedBucketWithDifferentBucketNumber`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write fixed bucket [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6460:
URL: https://github.com/apache/paimon/pull/6460#discussion_r2473622845
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/FlinkSinkBuilder.java:
##########
@@ -282,26 +340,22 @@ protected DataStreamSink<?> buildForFixedBucket(DataStream<InternalRow> input) {
+ " then the parallelism of writerOperator will be set to bucketNums.");
parallelism = bucketNums;
}
- DataStream<InternalRow> partitioned =
- partition(
- input,
- new RowDataChannelComputer(table.schema(), logSinkFunction != null),
- parallelism);
- FixedBucketSink sink = new FixedBucketSink(table, overwritePartition, logSinkFunction);
- return sink.sinkFrom(partitioned);
}
- private DataStreamSink<?> buildPostponeBucketSink(DataStream<InternalRow> input) {
- ChannelComputer<InternalRow> channelComputer;
- if (!table.partitionKeys().isEmpty()
- && table.coreOptions().partitionSinkStrategy() == PartitionSinkStrategy.HASH) {
- channelComputer = new RowDataHashPartitionChannelComputer(table.schema());
+ @Nullable
+ private Integer getPostponeFixedBucketNumber() {
+ // If data exists, use the current bucket number; otherwise, use sink.parallelism if set. If
+ // neither is set, use Flink's parallelism (get at runtime), but here we should use a
+ // default number.
+ List<SimpleFileEntry> simpleFileEntries =
+ table.store().newScan().onlyReadRealBuckets().readSimpleEntries();
Review Comment:
If part-1 bucket is 5, part-2 bucket is 10.
And now you are writing part-2, but read entry from part-1, what happen?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write fixed bucket [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6460:
URL: https://github.com/apache/paimon/pull/6460#discussion_r2469137660
##########
paimon-core/src/main/java/org/apache/paimon/operation/FileStoreCommitImpl.java:
##########
@@ -119,6 +119,9 @@ public class FileStoreCommitImpl implements FileStoreCommit {
private static final Logger LOG = LoggerFactory.getLogger(FileStoreCommitImpl.class);
+ private static final String POSTPONE_BATCH_WRITE_FIXED_BUCKET_PROPERTY_KEY =
Review Comment:
It is better to not modify this file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write real bucket [paimon]
Posted by "yuzelin (via GitHub)" <gi...@apache.org>.
yuzelin commented on PR #6460:
URL: https://github.com/apache/paimon/pull/6460#issuecomment-3442093238
Fixed comments. And add a property to snapshot.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write fixed bucket [paimon]
Posted by "yuzelin (via GitHub)" <gi...@apache.org>.
yuzelin commented on PR #6460:
URL: https://github.com/apache/paimon/pull/6460#issuecomment-3455053595
Fixed, copy bucket options to do so.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write fixed bucket [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6460:
URL: https://github.com/apache/paimon/pull/6460#discussion_r2473941090
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/FlinkSinkBuilder.java:
##########
@@ -282,26 +340,22 @@ protected DataStreamSink<?> buildForFixedBucket(DataStream<InternalRow> input) {
+ " then the parallelism of writerOperator will be set to bucketNums.");
parallelism = bucketNums;
}
- DataStream<InternalRow> partitioned =
- partition(
- input,
- new RowDataChannelComputer(table.schema(), logSinkFunction != null),
- parallelism);
- FixedBucketSink sink = new FixedBucketSink(table, overwritePartition, logSinkFunction);
- return sink.sinkFrom(partitioned);
}
- private DataStreamSink<?> buildPostponeBucketSink(DataStream<InternalRow> input) {
- ChannelComputer<InternalRow> channelComputer;
- if (!table.partitionKeys().isEmpty()
- && table.coreOptions().partitionSinkStrategy() == PartitionSinkStrategy.HASH) {
- channelComputer = new RowDataHashPartitionChannelComputer(table.schema());
+ @Nullable
+ private Integer getPostponeFixedBucketNumber() {
+ // If data exists, use the current bucket number; otherwise, use sink.parallelism if set. If
+ // neither is set, use Flink's parallelism (get at runtime), but here we should use a
+ // default number.
+ List<SimpleFileEntry> simpleFileEntries =
+ table.store().newScan().onlyReadRealBuckets().readSimpleEntries();
Review Comment:
Parallelism should be always inferred in runtime.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write fixed bucket [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6460:
URL: https://github.com/apache/paimon/pull/6460#discussion_r2473622845
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/FlinkSinkBuilder.java:
##########
@@ -282,26 +340,22 @@ protected DataStreamSink<?> buildForFixedBucket(DataStream<InternalRow> input) {
+ " then the parallelism of writerOperator will be set to bucketNums.");
parallelism = bucketNums;
}
- DataStream<InternalRow> partitioned =
- partition(
- input,
- new RowDataChannelComputer(table.schema(), logSinkFunction != null),
- parallelism);
- FixedBucketSink sink = new FixedBucketSink(table, overwritePartition, logSinkFunction);
- return sink.sinkFrom(partitioned);
}
- private DataStreamSink<?> buildPostponeBucketSink(DataStream<InternalRow> input) {
- ChannelComputer<InternalRow> channelComputer;
- if (!table.partitionKeys().isEmpty()
- && table.coreOptions().partitionSinkStrategy() == PartitionSinkStrategy.HASH) {
- channelComputer = new RowDataHashPartitionChannelComputer(table.schema());
+ @Nullable
+ private Integer getPostponeFixedBucketNumber() {
+ // If data exists, use the current bucket number; otherwise, use sink.parallelism if set. If
+ // neither is set, use Flink's parallelism (get at runtime), but here we should use a
+ // default number.
+ List<SimpleFileEntry> simpleFileEntries =
+ table.store().newScan().onlyReadRealBuckets().readSimpleEntries();
Review Comment:
If part-1 bucket is 5, part-2 bucket is 10.
And now you are writing part-2, but read entry from part-1, what happen?
Please add cases for this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [postpone][flink] Postpone bucket table supports to batch write real bucket [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #6460:
URL: https://github.com/apache/paimon/pull/6460#discussion_r2458488579
##########
docs/layouts/shortcodes/generated/core_configuration.html:
##########
@@ -923,6 +923,12 @@
<td>String</td>
<td>You can specify a pattern to get a timestamp from partitions. The formatter pattern is defined by 'partition.timestamp-formatter'.<ul><li>By default, read from the first field.</li><li>If the timestamp in the partition is a single field called 'dt', you can use '$dt'.</li><li>If it is spread across multiple fields for year, month, day, and hour, you can use '$year-$month-$day $hour:00:00'.</li><li>If the timestamp is in fields dt and hour, you can use '$dt $hour:00:00'.</li></ul></td>
</tr>
+ <tr>
+ <td><h5>postpone.batch-write-real-bucket</h5></td>
+ <td style="word-wrap: break-word;">false</td>
Review Comment:
default value should be true
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org