wwj6591812 commented on code in PR #8117:
URL: https://github.com/apache/paimon/pull/8117#discussion_r3465595303
##########
paimon-core/src/main/java/org/apache/paimon/table/source/ReadBuilderImpl.java:
##########
@@ -69,7 +72,18 @@ public class ReadBuilderImpl implements ReadBuilder {
public ReadBuilderImpl(InnerTable table) {
this.table = table;
this.partitionType = table.rowType().project(table.partitionKeys());
- this.defaultPartitionName = new
CoreOptions(table.options()).partitionDefaultName();
+ CoreOptions coreOptions = new CoreOptions(table.options());
+ this.defaultPartitionName = coreOptions.partitionDefaultName();
+ Integer scanBucket = coreOptions.scanBucket();
Review Comment:
Thanks for the review @JingsongLi.
You're right — scan.bucket was only applied in ReadBuilderImpl, so
table.copy(Map.of("scan.bucket", "0")).newScan().plan() still scanned all
buckets while other scan options worked on the direct scan path.
I've moved the option handling into AbstractDataTableScan: the constructor
now reads scan.bucket from CoreOptions, validates it via
ReadBuilderImpl.validateScanBucketOption(), and applies it to
SnapshotReader.withBucket(). This makes table.newScan() and
table.copy(...).newScan() behave consistently with other core scan options.
Added tests for the direct scan path
(testScanBucketOptionViaDirectTableScan, testScanBucketOptionViaTableCopy, and
rejection cases). Please take another look when you have time.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]