Fokko commented on code in PR #1849:
URL: https://github.com/apache/iceberg-rust/pull/1849#discussion_r2555453457


##########
crates/iceberg/src/spec/manifest/_serde.rs:
##########
@@ -258,6 +258,10 @@ fn parse_bytes_entry(v: Vec<BytesEntry>, schema: &Schema) 
-> Result<HashMap<i32,
                 })?
                 .clone();
             m.insert(entry.key, Datum::try_from_bytes(&entry.value, 
data_type)?);
+        } else {
+            // Field is not in current schema (e.g., dropped field due to 
schema evolution).
+            // Store the statistic as binary data to preserve it even though 
we don't know its type.
+            m.insert(entry.key, Datum::binary(entry.value.to_vec()));

Review Comment:
   Thanks @liurenjie1024 🙌 I would also prefer approach 2, but it is a little 
more nuanced. If you look at the error in the PR description, then these 
field-IDs are actually reserved IDs:
   
   <img width="721" height="1194" alt="image" 
src="https://github.com/user-attachments/assets/938300c8-764a-4b0c-9650-6ba4bfe2d68f";
 />
   
   From the [spec](https://iceberg.apache.org/spec/#reserved-field-ids). We 
could add a table with the reserved IDs
   



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