Add documentation for UNION schema handling.#17248
Conversation
| merged.retain(|k, v| input.get(k) == Some(&*v)); | ||
| } | ||
| merged | ||
| intersect_for_union(inputs) |
There was a problem hiding this comment.
Note that at construction, we handle the schema by intersection.
There was a problem hiding this comment.
since this function just calls another one, I think we could remove this one and call the other
| /// | ||
| /// ## Schema and Field Handling in Union Coercion | ||
| /// |
There was a problem hiding this comment.
Note that here in the analyzer, we handle union coercion differently than at construction.
| } | ||
| } | ||
|
|
||
| /// The metadata used in [`Field::metadata`]. |
There was a problem hiding this comment.
It would be good to describe the key and value, ideally with some example
There was a problem hiding this comment.
As we move to working with more field metadata, maybe should move this function into its own module -- datafusion/expr/src/metadata.rs or something 🤔
As a follow on PR
| /// # Returns | ||
| /// | ||
| /// A new `SchemaFieldMetadata` containing only the intersected metadata | ||
| pub fn intersect_for_union<'a>( |
There was a problem hiding this comment.
give this operates on metadata, I think we should have metadata in the name
| merged.retain(|k, v| input.get(k) == Some(&*v)); | ||
| } | ||
| merged | ||
| intersect_for_union(inputs) |
There was a problem hiding this comment.
since this function just calls another one, I think we could remove this one and call the other
| } | ||
| } | ||
|
|
||
| /// The metadata used in [`Field::metadata`]. |
There was a problem hiding this comment.
As we move to working with more field metadata, maybe should move this function into its own module -- datafusion/expr/src/metadata.rs or something 🤔
As a follow on PR
|
Thanks for the updates @alamb |
Which issue does this PR close?
Part of #12736
Rationale for this change
Demonstrate handling of union schema and metadata.
What changes are included in this PR?
Docs and very minor refactoring.
Are these changes tested?
N/A
Are there any user-facing changes?
New docs.