comphead commented on code in PR #3303:
URL: https://github.com/apache/iceberg-rust/pull/3303#discussion_r4157920270
##########
crates/iceberg/src/arrow/schema.rs:
##########
@@ -1320,6 +1306,12 @@ impl ArrowSchemaVisitor for MetadataStripVisitor {
/// including nested struct, list, and map fields. This is useful for schema
comparison
/// where metadata differences should be ignored.
///
+/// Two other differences are normalized away too, so that schemas that differ
only in
+/// them compare equal once stripped:
+/// - A map's entries field is renamed to [`DEFAULT_MAP_FIELD_NAME`] and made
non-nullable,
+/// as [`schema_to_arrow_schema`] builds it. Its key and value fields keep
their names.
Review Comment:
This says map key and value names are kept, but it is silent on list element
names. Are they kept on purpose? arrow-rs names list elements `item`
(`Field::new_list_field`) and `schema_to_arrow_schema` names them `element`, so
a stripped `List(item)` still differs from a stripped table `List(element)`.
If keeping them is the intent, one more sentence here would complete the
contract. If callers need them normalized, `LIST_FIELD_NAME` is the name to
rebuild with. That may not matter for datafusion-iceberg if DataFusion already
casts the input to the table's nested names, which is unverified.
--
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]