jordepic commented on code in PR #2647:
URL: https://github.com/apache/iceberg-rust/pull/2647#discussion_r3650479225
##########
crates/iceberg/src/arrow/record_batch_transformer.rs:
##########
@@ -619,7 +621,113 @@ impl RecordBatchTransformer {
})
.collect()
}
+}
+
+/// Look up an Iceberg field id from an Arrow field's `PARQUET:field_id`
metadata.
+fn arrow_field_id(field: &Field) -> Option<i32> {
Review Comment:
Good catch — added the guard: `build_struct_children` now errors when the
source struct has children but none of them carry a field id, rather than
null-filling every target child, with a test pinning it
(`promote_struct_without_source_field_ids_errors`).
On the reuse point: added `try_get_field_id_from_metadata` (the
`Result<Option<i32>>` shape you suggested) in `arrow/schema.rs` next to
`get_field_id_from_metadata`, which now delegates to it. It replaces
`arrow_field_id` here (so malformed metadata errors instead of silently
null-filling a column), the inline parse in
`build_field_id_to_arrow_schema_map`, and the copy in
`record_batch_projector::from_iceberg_schema`. Agreed that recursive name
mapping in `projection.rs` is its own 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]