JingsongLi commented on code in PR #11004:
URL: https://github.com/apache/paimon/pull/11004#discussion_r4490726019
##########
paimon-common/src/main/java/org/apache/paimon/predicate/LeafPredicateExtractor.java:
##########
@@ -30,11 +29,11 @@ public class LeafPredicateExtractor implements
PredicateVisitor<Map<String, Leaf
@Override
public Map<String, LeafPredicate> visit(LeafPredicate predicate) {
- Optional<FieldRef> fieldRefOptional = predicate.fieldRefOptional();
- if (!fieldRefOptional.isPresent()) {
- throw new UnsupportedOperationException();
- }
- return Collections.singletonMap(fieldRefOptional.get().name(),
predicate);
+ // A leaf on a transform such as UPPER(name) does not constrain the
field itself.
+ return predicate
+ .fieldRefOptional()
+ .map(fieldRef -> Collections.singletonMap(fieldRef.name(),
predicate))
Review Comment:
[P2] Preserve the residual when skipping a system-table transform
Skipping this leaf also requires preserving it for row filtering.
`FilesRead.withFilter` removes predicates over `partition`, `bucket`, or
`level` based on referenced field names, including transform leaves. With
partitions `{1, 10}` and `{2, 20}`, a Java SDK read filtered by
`UPPER(partition) = '{2, 20}'` with an explicit `newRead().executeFilter()` now
returns four file rows from both partitions instead of the two matching rows;
the equivalent direct equality control passes. This silently violates the
complete-filter contract on a query that previously failed explicitly. Please
retain skipped transforms as reader residuals and add a files-table SDK
regression.
--
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]