Fokko commented on code in PR #1849:
URL: https://github.com/apache/iceberg-rust/pull/1849#discussion_r2613140557
##########
crates/iceberg/src/spec/manifest/_serde.rs:
##########
@@ -245,8 +245,19 @@ struct BytesEntry {
fn parse_bytes_entry(v: Vec<BytesEntry>, schema: &Schema) ->
Result<HashMap<i32, Datum>, Error> {
let mut m = HashMap::with_capacity(v.len());
for entry in v {
- // We ignore the entry if the field is not found in the schema, due to
schema evolution.
- if let Some(field) = schema.field_by_id(entry.key) {
+ // First try to find the field in the schema, or check if it's a
reserved metadata field
+ let field_opt = schema.field_by_id(entry.key);
+ let metadata_field;
+ let field = if let Some(f) = field_opt {
+ Some(f)
+ } else if let Ok(f) = metadata_columns::get_metadata_field(entry.key) {
+ metadata_field = f;
+ Some(&metadata_field)
+ } else {
+ None
+ };
Review Comment:
Sweet 👍
--
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]