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

   ## Summary
   
   - Treat `record_count == 0` as empty in strict metrics evaluation.
   - Treat negative legacy/unknown counts conservatively as 
`ROWS_MIGHT_NOT_MATCH`.
   - Update the record-count short-circuit regression test.
   
   This prevents strict evaluation from classifying files with unknown counts 
as fully matching, which can incorrectly authorize whole-file deletion.
   
   Java validates newly built files with `recordCount >= 0` 
([DataFiles.java](https://github.com/apache/iceberg/blob/7f879b11366e17a676a03f15247a821751415529/core/src/main/java/org/apache/iceberg/DataFiles.java#L334-L341)),
 while manifest reads instantiate through Avro 
([GenericDataFile.java](https://github.com/apache/iceberg/blob/7f879b11366e17a676a03f15247a821751415529/core/src/main/java/org/apache/iceberg/GenericDataFile.java#L29-L37)).
 Its inclusive evaluator handles negative counts as unknown 
([InclusiveMetricsEvaluator.java](https://github.com/apache/iceberg/blob/7f879b11366e17a676a03f15247a821751415529/api/src/main/java/org/apache/iceberg/expressions/InclusiveMetricsEvaluator.java#L78-L87));
 the strict evaluator still groups them with empty files 
([StrictMetricsEvaluator.java](https://github.com/apache/iceberg/blob/7f879b11366e17a676a03f15247a821751415529/api/src/main/java/org/apache/iceberg/expressions/StrictMetricsEvaluator.java#L82-L85)).
   
   Related to #3498.
   
   ## Tests
   
   - `uv run pytest tests/expressions/test_evaluator.py -q`


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