Kontinuation opened a new pull request, #17524: URL: https://github.com/apache/datafusion/pull/17524
## Which issue does this PR close? - Closes #17422. ## Rationale for this change As reported by #17422, extension metadata was dropped in some queries involving subqueries. This happens when a column references another column in a correlated subquery, which creates an `OuterReferenceColumn` in DataFusion's logical plan. `OuterReferenceColumn` is defined to contain a data type and a referenced column. As we know, outer reference column refers to a field in another table, so there's no way to retrieve the field metadata of referenced column given the schema of the current table. To overcome this problem, we define `OuterReferenceColumn` to contain the entire referenced field as a `FieldRef`. We also updated the implementation of `to_field` to return the referenced field, which contains the original metadata of referenced field. ## What changes are included in this PR? Changed `OuterReferenceColumn` to contain the referenced outer field as a `FieldRef`. ## Are these changes tested? * Added a unit test * Added the repro in the issue to `user_defined_scalar_functions` test ## Are there any user-facing changes? Yes. This changes part of the public API. -- 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]
