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

refactor: clean up arrow schema defs #1590

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

polynomialherder
Copy link
Contributor

@polynomialherder polynomialherder commented Aug 15, 2023

Description

The Arrow schema definitions in delta_log_schema_for_table are currently a bit tricky to read -- it's not straightforward to tell from looking at, say, this line to which field that particular true belongs. This adds a few helper macros that hopefully make this a little more readable, and replaces the existing definitions with calls to those macros that result in equivalent code.

These macros are fairly tailored to these specific schema definitions, so I just included them in the delta_arrow module, but happy to break them off into their own module and include tests for them. I mostly wanted to see if this sort of a refactor would be welcome given that I've seen discussion about moving away from using Arrow internally over the long term (?)

This change adds some helper macros for defining Arrow schemas. The goal
is to improve readability and reduce repetition so that modifying these
definitions is less error prone.
Copy link
Collaborator

@roeap roeap left a comment

Choose a reason for hiding this comment

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

Thanks @polynomialherder - much more legible now 👍.

@roeap roeap merged commit 0f85033 into delta-io:main Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/rust Issues for the Rust crate rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants