Skip to content

Commit 05cf534

Browse files
doc: Clarify arrow_schema_to_schema requires fields with field id (#1151)
## Which issue does this PR close? - Closes #1061 . ## What changes are included in this PR? Add doc for arrow_schema_to_schema --------- Co-authored-by: Renjie Liu <[email protected]>
1 parent 76e87a8 commit 05cf534

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/iceberg/src/arrow/schema.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ fn visit_schema<V: ArrowSchemaVisitor>(schema: &ArrowSchema, visitor: &mut V) ->
213213
}
214214

215215
/// Convert Arrow schema to Iceberg schema.
216+
///
217+
/// Iceberg schema fields require a unique field id, and this function assumes that each field
218+
/// in the provided Arrow schema contains a field id in its metadata. If the metadata is missing
219+
/// or the field id is not set, the conversion will fail
216220
pub fn arrow_schema_to_schema(schema: &ArrowSchema) -> Result<Schema> {
217221
let mut visitor = ArrowSchemaConverter::new();
218222
visit_schema(schema, &mut visitor)

0 commit comments

Comments
 (0)