Copilot commented on code in PR #3830:
URL: https://github.com/apache/iceberg-rust/pull/3830#discussion_r4813532448


##########
crates/iceberg/src/arrow/reader/projection.rs:
##########
@@ -82,8 +82,10 @@ impl ArrowReader {
         ) -> bool {
             match (file_type, projected_type) {
                 (Some(lhs), Some(rhs)) if lhs == rhs => true,
+                (Some(PrimitiveType::Unknown), Some(_)) => true,
                 (Some(PrimitiveType::Int), Some(PrimitiveType::Long)) => true,
                 (Some(PrimitiveType::Float), Some(PrimitiveType::Double)) => 
true,
+                (Some(PrimitiveType::Date), Some(PrimitiveType::Timestamp)) => 
true,

Review Comment:
   Date-to-microsecond promotion can also overflow: the valid Date32 value 
`106751992` days exceeds `i64::MAX` after scaling. This newly allowed path 
reaches the default cast in `record_batch_transformer.rs:499`, which silently 
converts overflow to NULL ([Arrow default-branch 
implementation](https://github.com/apache/arrow-rs/blob/1bb736bf0d468e79f52a69bab6afa8d35043cc10/arrow-cast/src/cast/mod.rs#L1913-L1919)).
 Use a checked conversion returning `DataInvalid` with boundary tests, or defer 
this promotion alongside date-to-nanosecond support.



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