adiranjan25 opened a new pull request, #19197:
URL: https://github.com/apache/iceberg/pull/19197

   Fixes #19191.
   
   ## Problem
   
   ORC predicate pushdown incorrectly skips matching rows
   when evaluating negated equality predicates against
   columns containing only NULL values.
   
   This affects Spark SQL IS DISTINCT FROM predicates
   and can result in silent query-result omissions.
   
   ## Root Cause
   
   The generic NOT conversion bypasses the existing
   null-aware conversion of Iceberg NOT_EQ predicates.
   
   ORC SearchArguments follow SQL null semantics,
   which differ from Iceberg expression semantics.
   
   ## Solution
   
   Normalize negated Iceberg expressions using
   Expressions.rewriteNot() before converting them
   into ORC SearchArguments.
   
   This allows the existing predicate-specific conversion
   logic to preserve NULL semantics without disabling
   predicate pushdown.
   
   ## Validation
   
   Added regression coverage for:
   
   - Negated equality against an all-NULL ORC column.
   - Spark SQL IS DISTINCT FROM.
   - Local and distributed scan planning.
   - Comparison against a non-pushed-down predicate.
   
   Before the fix:
   - Expected matching IDs: [1, 3]
   - Actual matching IDs: [1]
   - Both Spark regression cases failed.
   
   After the fix:
   - Targeted ORC and Spark validation succeeded.
   - The previously failing Spark regression passed.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to