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


##########
paimon-core/src/main/java/org/apache/paimon/table/source/AbstractDataTableScan.java:
##########
@@ -119,10 +120,48 @@ public InnerTableScan withFilter(Predicate predicate) {
 
     @Override
     public AbstractDataTableScan withBucket(int bucket) {
+        validateScanBucketOption(schema, options, bucket);

Review Comment:
   This validation is now on the generic `withBucket(int)` path, so it changes 
the existing public read API, not just the new `scan.bucket` option. 
`ReadBuilder` is `@Public` and `withBucket` previously delegated directly to 
the snapshot reader, which allowed callers to scan a physical bucket on 
fixed-bucket append tables as well. After this change, 
`table.newReadBuilder().withBucket(0).newScan()` (and 
`table.newScan().withBucket(0)`) throws for any table without primary keys, 
even when `bucket > 0`. If the new SQL/table option is intended to be PK-only, 
can we keep this check on the `CoreOptions.SCAN_BUCKET` auto-application path 
and avoid tightening the existing `withBucket` API?



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