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

[flight] make the enforce_schema function public #147

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

ccciudatu
Copy link
Collaborator

Expose the (slightly enhanced) enforce_schema function to downstream application code.

Copy link
Collaborator

@phillipleblanc phillipleblanc left a comment

Choose a reason for hiding this comment

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

Thanks!

@ccciudatu
Copy link
Collaborator Author

FWIW, I think this functionality is generic enough to be useful in a far broader context, beyond flight and even table-providers. My guess is there are variations of this already rewritten again and again across various projects.
@alamb do you think this would be a good fit for upstream crates like arrow-cast or datafusion-common?

@ccciudatu ccciudatu merged commit 53182e0 into datafusion-contrib:main Oct 20, 2024
3 checks passed
@ccciudatu ccciudatu deleted the flight-next branch October 20, 2024 09:43
@alamb
Copy link
Contributor

alamb commented Oct 22, 2024

FWIW, I think this functionality is generic enough to be useful in a far broader context, beyond flight and even table-providers. My guess is there are variations of this already rewritten again and again across various projects. @alamb do you think this would be a good fit for upstream crates like arrow-cast or datafusion-common?

I took a quick look at what enforce_schema does and it looks to me like it does something called "schema evolution" in other contexts

This code in DataFusion seems to do the same thing (map a batch schema to a target schema, filling in null columns / casting types when needed):
https://docs.rs/datafusion/latest/datafusion/datasource/schema_adapter/struct.DefaultSchemaAdapterFactory.html

@alamb
Copy link
Contributor

alamb commented Oct 22, 2024

The docs were a bit lackluster so I added some more here: apache/datafusion#13063

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants