mbutrovich opened a new issue, #3725:
URL: https://github.com/apache/iceberg-rust/issues/3725

   ### Apache Iceberg Rust version
   
   `main` (641f59049)
   
   ### Describe the bug
   
   `impl Display for Datum` ends in [`(_, _) => 
unreachable!()`](https://github.com/apache/iceberg-rust/blob/641f59049e0aefad0c60e19915ecdb54933e002f/crates/iceberg/src/spec/values/datum.rs#L351-L353),
 and no earlier arm matches `PrimitiveLiteral::AboveMax` or 
`PrimitiveLiteral::BelowMin`. `Datum::to` returns such a datum when a value is 
outside the target type's range, so formatting the result of a public 
conversion with `{}` panics. Binding `IN` keeps these literals in the bound set 
(#3716), so a bound predicate can carry one into an error message or a log line.
   
   ### To Reproduce
   
   ```rust
   let d = Datum::long(1_i64 << 40)
       .to(&Type::Primitive(PrimitiveType::Int))
       .unwrap();
   println!("{d:?}"); // Datum { type: Int, literal: AboveMax }
   println!("{d}"); // panics: internal error: entered unreachable code
   ```
   
   ### Expected behavior
   
   `Display` prints something for every `Datum`, such as `AboveMax` or 
`BelowMin`, instead of panicking.
   
   ### Willingness to contribute
   
   I cannot contribute a fix for this bug at this time
   


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