SAMARTHJAISWAL opened a new pull request, #3717:
URL: https://github.com/apache/iceberg-rust/pull/3717

   ## Which issue does this PR close?
   
   - Closes #3716.
   
   ## What changes are included in this PR?
   
   Binding a comparison turns a literal outside the field type's range into 
`AlwaysTrue` or `AlwaysFalse`, but binding `IN` / `NOT IN` kept such a literal 
in the set as `AboveMax` / `BelowMin`. The Arrow reader cannot convert that 
literal, so `c1 IN (3, -9223372036854775808)` on an `int` column panicked in 
`predicate_visitor.rs`.
   
   A literal outside the range equals no value of the field, so it is now 
removed from the set when binding. The existing rules then apply to what is 
left: `c1 IN (3, <out of range>)` binds to `c1 = 3`, a set with only 
out-of-range literals binds to `False` for `IN` and `True` for `NOT IN`.
   
   This is option 2 from the issue. The two `.unwrap()` calls in 
`predicate_visitor.rs` are not changed here; #3448 turns them into `?`.
   
   ## Are these changes tested?
   
   Five unit tests in `expr/predicate.rs` for `IN` and `NOT IN` with literals 
above and below the `int` range. They fail without the change. I ran the 
`expr::` tests of the `iceberg` crate (381 pass), `cargo fmt --check` and 
`cargo clippy -p iceberg`. I did not run the query from the issue through 
DataFusion, or the full workspace test suite.
   
   ## AI Disclosure
   
   I used an AI assistant (Claude) to locate the cause and to write the change, 
the tests and this description. I reviewed all of it and ran the tests myself. 
One assumption to check: I treat `NOT IN` the same as `IN` for out-of-range 
literals, on the grounds that `x != <out of range>` already binds to 
`AlwaysTrue`.
   


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