CTTY commented on code in PR #3564:
URL: https://github.com/apache/iceberg-rust/pull/3564#discussion_r4766455672
##########
crates/iceberg/src/spec/transform.rs:
##########
@@ -221,6 +221,9 @@ impl Transform {
(Self::Hour, PrimitiveLiteral::Int(ordinal)) =>
Self::human_hour(ordinal),
(_, value) => {
let field_type = field_type.as_primitive_type().unwrap();
+ // A value written before its source column was promoted (`int`
+ // to `long`, `float` to `double`) still carries the old type.
+ let value = value.promote_to(field_type).unwrap_or(value);
Review Comment:
I'll move it to another function. I also checked java's implementation and
found they simply promote it when reading the manifests. I think that could be
a cleaner solution but it could be too much change for the current PR
--
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]