riverandeye opened a new pull request, #2728:
URL: https://github.com/apache/iceberg-go/pull/2728

   Fixes #2727
   
   The inclusive metrics evaluator always kept a data file for `!=` and `NOT 
IN`. When a column's lower and upper bounds are equal and the file has no 
nulls, every row holds that one value, so the file can be skipped if that value 
is excluded. The manifest evaluator already does this for partitions with 
`uniqueValue`, and Java's `InclusiveMetricsEvaluator` does it for data files.
   
   ### Change
   
   - `inclusiveMetricsEval.uniqueValue` returns the column's only value, or 
`nil` when the stats don't prove one. It follows the manifest evaluator's 
[`uniqueValue`](https://github.com/apache/iceberg-go/blob/b9a9bd92e4d89ef9b2619a65d018e9e9905d456c/table/evaluators.go#L253-L290)
 and returns `nil` when:
     - the column may contain nulls,
     - either bound is missing, or the bound bytes differ,
     - the column is a float or double whose NaN count is unknown or non-zero, 
or the value is NaN or zero (signed zeros),
     - the term is a variant extract or a geo column.
   - `VisitNotEqual` and `VisitNotIn` return `rowsCannotMatch` when that value 
equals the literal or is in the set.
   
   ### Tests
   
   - `TestNotEqualAndNotInSingleValue` in `InclusiveMetricsTestSuite` covers 
the cases from Java's `testNotEqWithSingleValue` and 
`testNotInWithSingleValue`, plus unknown NaN counts and zero floats.
   - `TestScanRowFilterNotEqualSingleValueFile` appends one file whose `region` 
is all `"us"` and one with `"us"` and `"eu"`, then checks that `region != 'us'` 
and `region NOT IN ('us', 'kr')` plan only the second file and return the right 
rows.
   
   The skip cases in both tests fail on main. `go test ./...` and 
`golangci-lint run ./table/` pass.
   
   I also loaded a table written by iceberg-go into Iceberg Java and planned 
files for the same `!=` and `NOT IN` filters on a string and a double column. 
With this change, both pick the same files for every filter. On main, 
iceberg-go keeps the single-value file for all of them.
   


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