JingsongLi commented on code in PR #1077:
URL: https://github.com/apache/paimon-rust/pull/1077#discussion_r4230593657


##########
crates/paimon/src/table/read_builder.rs:
##########
@@ -65,7 +65,8 @@ pub(super) fn split_scan_predicates(
     filter: Predicate,
 ) -> (Option<Predicate>, Vec<Predicate>) {
     let partition_keys = table.schema().partition_keys();
-    if partition_keys.is_empty() {
+    // Auth rules may mask partition keys; retain the full read predicate.
+    if partition_keys.is_empty() || 
table.schema().core_options().query_auth_enabled() {
         (None, filter.split_and())

Review Comment:
   [P2] Preserve partition-only filters when enabling chunk shuffle
   
   With `query-auth.enabled=true`, this branch leaves even a pure partition 
predicate in `data_predicates`. `TableScan::with_chunk_shuffle()` still rejects 
any nonempty `data_predicates`, so a REST-loaded append table with an 
unrestricted grant now fails on 
`builder.with_filter(partition_predicate).new_scan().with_chunk_shuffle(7, 2)` 
with `chunk_shuffle only supports partition predicates`, before authorization 
can restore partition pruning. Python's `with_chunk_shuffle` is affected as 
well.
   
   I verified that the same test using real Parquet files and a mock REST 
catalog passes on base `d8205a0` (including planning and reading) and fails on 
head `4bd05f26`. Please check shuffle compatibility after authorization has 
separated the safe partition predicates, or distinguish partition-only 
residuals from actual data predicates, so unmasked partition filters remain 
supported.



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