wiedld opened a new pull request, #12658: URL: https://github.com/apache/datafusion/pull/12658
## Which issue does this PR close? Related to #12560 ## Rationale for this change A [PR merged](https://github.com/apache/datafusion/pull/11989) (and released in 42.0.0) has [added a check](https://github.com/apache/datafusion/blob/322d83526909ab44cfbe34b982d1a1c36a4dbe8f/datafusion/core/src/physical_planner.rs#L676) that the logical and physical plan input schemas (to an aggregate node) are the same. Once released into the wild, it began being triggered. One [example case](https://github.com/apache/datafusion/blob/322d83526909ab44cfbe34b982d1a1c36a4dbe8f/datafusion/core/src/physical_planner.rs#L676) is where field metadata is in the logical plan, but missing from the physical plan. I haven't yet re-created that exact reproducer. However, I ended up creating the inverse case. Where the metadata is in the physical plan, but missing from the logical plan. ## What changes are included in this PR? First commit: changed the [From DFSchema for SchemaRef](https://github.com/apache/datafusion/blob/84e9ce8ebf27c376c43b9eddf6b6bbb282426731/datafusion/common/src/dfschema.rs#L862), so it stops dropping the metadata. Second commit: demonstrate that test cases (where metadata is on the data) end up failing due to the same error as in #12560. ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> -- 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]
