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

Define and use a get_log_add_schema() function #407

Merged
merged 3 commits into from
Oct 23, 2024

Conversation

scovich
Copy link
Collaborator

@scovich scovich commented Oct 17, 2024

We have a convenient get_log_schema() function for accessing the Delta log schema, but many operations only need to access the add column. Replace clunky projection code with something direct and infallible, wrapped up as get_log_add_schema().

While we're at it, make both functions return SchemaRef instead of Schema, to reduce the number of deep clones needed (many use sites anyway need an arc).

Copy link
Collaborator

@zachschuermann zachschuermann left a comment

Choose a reason for hiding this comment

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

just an overall question: do we want the static LOG_*SCHEMA to be an Arc? doesn't a static reference also implement the Send/Sync/etc. that we need? (and possibly marginally lighter weight?)

@scovich
Copy link
Collaborator Author

scovich commented Oct 18, 2024

just an overall question: do we want the static LOG_*SCHEMA to be an Arc? doesn't a static reference also implement the Send/Sync/etc. that we need? (and possibly marginally lighter weight?)

Rationale (from PR description):

make both functions return SchemaRef instead of Schema, to reduce the number of deep clones needed (many use sites anyway need an arc).

Basically, it's easy/cheap to get a &Schema from an arc.. not so cheap to get an arc from a borrowed reference.

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.82%. Comparing base (8de8689) to head (eb3a7e0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
kernel/src/actions/mod.rs 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
+ Coverage   78.80%   78.82%   +0.02%     
==========================================
  Files          51       51              
  Lines       10647    10655       +8     
  Branches    10647    10655       +8     
==========================================
+ Hits         8390     8399       +9     
  Misses       1788     1788              
+ Partials      469      468       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@zachschuermann zachschuermann left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@nicklan nicklan left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@scovich scovich merged commit 7385d19 into delta-io:main Oct 23, 2024
17 checks passed
@scovich scovich deleted the log-add-schema branch November 8, 2024 21:00
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