chenjian2664 commented on code in PR #11004:
URL: https://github.com/apache/paimon/pull/11004#discussion_r4533936665


##########
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))
+                .orElse(Collections.emptyMap());

Review Comment:
   Thanks, confirmed and fixed. `$snapshots`, `$schemas`, `$manifests` and 
`$consumers` only used the filter to narrow IDs, so a transform leaf that the 
extractor now skips was applied nowhere. I added 
`LeafPredicateExtractor.transformConjuncts`, which returns the AND conjuncts 
that contain a transform leaf. These four reads now evaluate those conjuncts on 
the rows before the output projection.
   
   Plain conjuncts keep the existing ID pushdown, so the Java `String` `IN` 
case behaves as before. I added regressions for `UPPER(consumer_id) = 'ID1'` on 
`$consumers` and for an ID range combined with `LOWER(commit_kind)` on 
`$snapshots`.



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