Friede80 opened a new pull request, #15135: URL: https://github.com/apache/datafusion/pull/15135
## Which issue does this PR close? - Closes #15134 ## Rationale for this change At the core, if a `Union` goes through the `TypeCoercion` analyzer twice, the schema can drop the qualifier information for fields that were cast in the first pass of `TypeCoercion`. To preserve this information, this PR changes `coerce_union_schema` to start from the schema of the `Union` instead of the schema of the first child. ## Are these changes tested? Yes ## Are there any user-facing changes? Yes, this changes the signature of `coerce_union_schema` so that the schema carried by the `Union` is available. Before: ```rust pub fn coerce_union_schema(inputs: &[Arc<LogicalPlan>]) -> Result<DFSchema> ``` After: ```rust pub fn coerce_union_schema(union_plan: &Union) -> Result<DFSchema> ``` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org