Skip to content
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

fix: Force use index-based column mapping for old ORC file #12489

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

Conversation

ccat3z
Copy link
Contributor

@ccat3z ccat3z commented Feb 28, 2025

An ORC file written by an old version has no field names in the physical schema, always map column names by index.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 28, 2025
Copy link

netlify bot commented Feb 28, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 18478bc
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67c17556239e44000844be93

Copy link
Contributor

@Yuhta Yuhta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hacky, your metadata service should keep this information and set useColumnNamesForColumnMapping=false accordingly for these files.

@ccat3z
Copy link
Contributor Author

ccat3z commented Mar 3, 2025

cc @kecookier

@ccat3z
Copy link
Contributor Author

ccat3z commented Mar 3, 2025

This is hacky, your metadata service should keep this information and set useColumnNamesForColumnMapping=false accordingly for these files.

It's impossible to check if it's old ORC files without reading it. And it's a logical error to use useColumnNamesForColumnMapping on these ORC files without column names. Spark will determine whether it is an old version when actually reading the ORC, perhaps an option like autoUseColumnPositionForOldOrc can be added to support this behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants