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

Preserve field metadata across expressions in logical plans #6920

Merged
merged 3 commits into from
Jul 13, 2023

Conversation

sydduckworth
Copy link
Contributor

Which issue does this PR close?

Closes #6886.

Rationale for this change

This change improves support for extension types by allowing access to field metadata at the logical planning stage.

What changes are included in this PR?

  • Added ExprSchemable::metadata method.
    • Forwards metadata for column and alias expressions
    • All other expressions return empty metadata
  • Updated ExprSchemable::to_field to populate field metadata.
  • Added metadata utility methods metadata and with_metadata to DFField to match Field methods in arrow-rs.

Are these changes tested?

Yes

Are there any user-facing changes?

No

Dexter Duckworth added 3 commits July 11, 2023 10:31
- Column and Alias exprs now forward field metadata.
- All other expressions return empty metadata.
@github-actions github-actions bot added the logical-expr Logical plan and expressions label Jul 11, 2023
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @dexterduck

The whole way the DFField is implemented is somewhat sad (but has nothing to do with you).

@alamb
Copy link
Contributor

alamb commented Jul 12, 2023

FYI @mustafasrepo -- related to #6839 -- this is another example where if DFField was some sort of wrapper around an arrow field it would likely be easier to use as well as faster

@alamb alamb merged commit 41b6a58 into apache:main Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preserve field metadata across expressions in logical plans
2 participants