tanmayrauth opened a new pull request, #3521:
URL: https://github.com/apache/iceberg-python/pull/3521

   
   
   _StrictMetricsEvaluator.visit_not_equal and visit_not_in short-circuited on 
_can_contain_nulls / _can_contain_nans (null/NaN count > 0) and returned 
ROWS_MUST_MATCH without checking the value bounds. A file holding any null or 
NaN was therefore reported as fully matching the predicate, even when a 
non-null value inside the bounds did not match.
   
   This drives _DeleteFiles (table/update/snapshot.py): ROWS_MUST_MATCH drops 
the whole data file without rewriting it. So delete(NotEqualTo("x", 5)) against 
a file with stats [null, 5] and bounds lower=upper=5 would delete the entire 
file, silently losing the row with value 5 that should have survived.
   
   Every other strict ROWS_MUST_MATCH path already guards on the "only" 
variants (_contains_nulls_only / _contains_nans_only), matching the reference 
StrictMetricsEvaluator. Switch both methods to the same guard so that an 
all-null/all-NaN column still short-circuits to ROWS_MUST_MATCH (those rows 
satisfy not-equal/not-in), while a partially-null column falls through to the 
bounds check.
   
   Update the existing NotIn-on-some-nulls test that encoded the buggy result 
and add a regression test covering the [null, value] / bounds-include-literal 
case for both NotEqualTo and NotIn.
   
   Fixes #3498 (partially)
   
   <!--
   Thanks for opening a pull request!
   -->
   
   <!-- In the case this PR will resolve an issue, please replace 
${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
   <!-- Closes #${GITHUB_ISSUE_ID} -->
   
   # Rationale for this change
   
   ## Are these changes tested?
   
   ## Are there any user-facing changes?
   
   <!-- In the case of user-facing changes, please add the changelog label. -->
   


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