anoopj commented on code in PR #3483:
URL: https://github.com/apache/iceberg-rust/pull/3483#discussion_r4333164569
##########
crates/iceberg/src/spec/manifest/data_file.rs:
##########
@@ -184,7 +186,36 @@ pub struct DataFile {
pub(crate) content_size_in_bytes: Option<i64>,
}
+fn promote_partition_value(value: Option<&Literal>, field: &NestedFieldRef) ->
Option<Literal> {
+ match value {
+ Some(Literal::Primitive(primitive)) => {
+ let promoted = match field.field_type.as_primitive_type() {
+ // The partition source column was dropped, so there is no
target type to
+ // widen to; widen to the promotion ceiling instead so this
value and its
+ // deletes still normalize to the same type and the delete
index matches.
+ Some(PrimitiveType::Unknown) => primitive.widen(),
Review Comment:
You're right that the ceiling-widen-everything version corrupted a dropped
date into `Long(days)`. @JeonDaehong / @mbutrovich surfaced the same on the
delete-matching side, so I changed the Unknown branch to decide by the
manifest's written type: a dropped int/float still widens to its ceiling, but a
dropped date (or any non-numeric) is copied through unchanged.
--
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]