Skip to content

[SPARK-49110][SQL] Fix reading metadata columns for tables with CHAR columns #51154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomvanbussel
Copy link
Contributor

What changes were proposed in this pull request?

This PR modifies SubqueryAlias to propagate the metadata output of its child if the is a Project injected by ApplyCharTypePadding.

Why are the changes needed?

This is needed because with these changes it is not possible to read metadata columns when reading a table with a CHAR column when read-side padding is enabled. In the case the plan is SubqueryAlias(Project(LeafNode))), so without this patch the metadata output is not propagated.

Does this PR introduce any user-facing change?

Yes, there will be more cases in which the metadata columns can be accessed, and users will no longer get an exception in these cases.

How was this patch tested?

Added a case to MetadataColumnSuite.

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant