jerry-024 commented on code in PR #7486:
URL: https://github.com/apache/paimon/pull/7486#discussion_r2963950063
##########
paimon-common/src/main/java/org/apache/paimon/predicate/PredicateReplaceVisitor.java:
##########
@@ -37,6 +37,10 @@ default Optional<Predicate> visit(CompoundPredicate
predicate) {
return Optional.empty();
}
}
- return Optional.of(new CompoundPredicate(predicate.function(),
converted));
+ if (predicate.function() instanceof And) {
+ return Optional.of(PredicateBuilder.and(converted));
+ } else {
+ return Optional.of(PredicateBuilder.or(converted));
Review Comment:
~~Changing the default method of `PredicateReplaceVisitor` affects all
implementations (e.g. `PredicateProjectionConverter`), not just the new
`PartitionValuePredicateVisitor`.~~
Retracted: the simplification (`AND(AlwaysTrue, x) → x`, `OR(AlwaysFalse, x)
→ x`) is semantically always correct, and no existing visitor produces
`AlwaysTrue`/`AlwaysFalse`, so behavior is unchanged. Putting it in the default
method is the right choice — it provides a better default for any future
visitor as well.
--
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]