JingsongLi commented on code in PR #8117:
URL: https://github.com/apache/paimon/pull/8117#discussion_r3464816449


##########
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:
   `scan.bucket` is now a CoreOptions scan option, but it is only consumed by 
`ReadBuilderImpl`. Core scan options such as `scan.snapshot-id` are also 
honored when callers do `table.copy(dynamicOptions).newScan().plan()`, and 
there are existing core tests/users on that path. With this implementation, 
`table.copy(Map.of("scan.bucket", "0")).newScan().plan()` still scans all 
buckets while `table.copy(...).newReadBuilder().newScan().plan()` scans one 
bucket, so the same table options produce different results depending on 
whether the caller goes through `ReadBuilder`. Please apply/validate the option 
in the `DataTableScan`/`SnapshotReader` path as well, or keep it out of 
CoreOptions if it is intended to be ReadBuilder-only.



-- 
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]

Reply via email to