wiedld commented on code in PR #17249:
URL: https://github.com/apache/datafusion/pull/17249#discussion_r2286497514
##########
datafusion/common/src/dfschema.rs:
##########
@@ -297,6 +297,19 @@ impl DFSchema {
/// Modify this schema by appending the fields from the supplied schema,
ignoring any
/// duplicate fields.
+ ///
+ /// ## Merge Precedence
+ ///
+ /// **Schema-level metadata**: Metadata from both schemas is merged.
+ /// If both schemas have the same metadata key, the value from the second
`other_schema` parameter takes precedence.
+ ///
+ /// **Field-level merging**: Only non-duplicate fields are added. This
means that the
+ /// first `self` fields will always take precedence over the second
`other_schema` fields.
+ /// Duplicate field detection is based on:
+ /// - For qualified fields: both qualifier and field name must match
+ /// - For unqualified fields: only field name needs to match
+ ///
+ /// Note: the merging operation prefers the first `self` fields, and the
second `other_schema` metadata.
Review Comment:
Note that this definition of schema merging behaves a differently in
precedence for fields (prefer self), vs metadata (prefer other).
--
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]