Stephen0421 opened a new pull request, #9427:
URL: https://github.com/apache/paimon/pull/9427

   ### Purpose
   
   This PR extends `PredicateConverter` to support negated predicates while 
preserving SQL three-valued logic.
   
   The main changes include:
   
   - Add expression-level `NOT` conversion with double-negation elimination.
   - Apply De Morgan's law to negated `AND` and `OR` expressions.
   - Map negated comparisons to their opposite operators.
   - Support `NOT IN` through `PredicateBuilder.notIn`.
   - Support `NOT BETWEEN` through the structured negation of `Between`.
   - Support negated `IS NULL` and `IS NOT NULL`.
   - Support `IS NOT TRUE`, `IS NOT FALSE`, and their unary negations with 
correct NULL semantics.
   - Keep unsupported negations, such as prefix `NOT LIKE`, as Flink residual 
filters.
   - Reuse the existing typed literal conversion for `BETWEEN` introduced by 
#9310.
   
   The conversion failure contract remains unchanged: expressions that cannot 
be converted safely are not consumed by the source and remain for Flink 
evaluation.
   
   ### Tests
   
   - Added unit tests for:
     - `IN` and `NOT IN`, including NULL literals and large-IN predicates.
     - `NOT BETWEEN` predicate structure.
     - Negation of all comparison operators with literals on either side.
     - Nested `AND` / `OR` negation and double `NOT`.
     - `IS TRUE`, `IS FALSE`, `IS NOT TRUE`, and `IS NOT FALSE` over TRUE, 
FALSE, and NULL.
     - Unsupported `NOT LIKE` conversion.
     - Accepted predicates and remaining source filters.
   
   - Added a nullable SQL integration test covering `NOT BETWEEN`, `NOT IN`, 
and boolean truth predicates.
   
   - Verified with Flink 1 and Flink 2:
     - `PredicateConverterTest` and `FlinkTableSourceTest`: 65 tests passed for 
each profile.
     - `ReadWriteTableITCase#testNullablePredicateThreeValuedLogic`: passed for 
each profile.


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