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

   ## Which issue does this PR close?
   
   - Closes #3813.
   
   ## What changes are included in this PR?
   
   `Datum::to` converts `int` to `long` and `long` to `int` only when the 
literal's own type is `int` or `long`. Same-type conversions fall through to 
the existing same-type arm, and the conversions listed in #3813 return an error.
   
   #496 added the `date` and `int` conversions for `day` partitions. The `day` 
transform's result type is now `date` 
([transform.rs#L361-L368](https://github.com/apache/iceberg-rust/blob/6cca8cdec6881d057581bdf9cc21c3ad426c0283/crates/iceberg/src/spec/transform.rs#L361-L368)),
 so its projected predicates carry `date` literals.
   
   Java's `IntegerLiteral.to` still converts `int` to `date` 
([Literals.java#L265-L266](https://github.com/apache/iceberg/blob/06f1574471c4603443a67f78af72e4e1d0aeacea/api/src/main/java/org/apache/iceberg/expressions/Literals.java#L265-L266)).
 The [expressions 
spec](https://github.com/apache/iceberg/blob/06f1574471c4603443a67f78af72e4e1d0aeacea/format/expressions-spec.md?plain=1#L127)
 requires the error, so this PR follows the spec there.
   
   #3574 rewrites the same match arms, so whichever PR merges second needs to 
keep the source-type checks.
   
   ## Are these changes tested?
   
   Yes, in `crates/iceberg/src/spec/values/tests.rs` and 
`crates/iceberg/src/expr/predicate.rs`.
   
   ## AI Disclosure
   
   I wrote this PR with help from Claude but understand and support the core 
approach, implementation, and test coverage.
   


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