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

feat!(ffi): new visit_schema FFI and rename old visit_schema to visit_snapshot_schema #683

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

zachschuermann
Copy link
Collaborator

@zachschuermann zachschuermann commented Feb 7, 2025

What changes are proposed in this pull request?

When given a schema (e.g. in global_scan_state) the engine needs a way to visit this schema. This introduces a new API visit_schema to allow engines to visit any schema over FFI. An API called visit_schema previously existed but visited the schema of a given snapshot; this has now been renamed to visit_snapshot_schema.

This PR affects the following public APIs

Renamed visit_schema to visit_snapshot_schema and now visit_schema takes SharedSchema as an argument instead of a snapshot.

How was this change tested?

updated read_table test

@zachschuermann zachschuermann changed the title feat(ffi): new feat!(ffi): new visit_schema FFI and rename old visit_schema to visit_snapshot_schema Feb 7, 2025
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 84.22%. Comparing base (2e4f555) to head (3db0d7b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
ffi/src/schema.rs 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #683      +/-   ##
==========================================
- Coverage   84.27%   84.22%   -0.06%     
==========================================
  Files          77       77              
  Lines       17950    17960      +10     
  Branches    17950    17960      +10     
==========================================
- Hits        15127    15126       -1     
- Misses       2107     2119      +12     
+ Partials      716      715       -1     

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

Copy link
Collaborator

@scovich scovich left a comment

Choose a reason for hiding this comment

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

Good cleanup. For some reason I thought we'd already made this change, but clearly not!

@scovich scovich added the breaking-change Change that will require a version bump label Feb 7, 2025
Copy link
Collaborator

@OussamaSaoudi OussamaSaoudi left a comment

Choose a reason for hiding this comment

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

Looks like we need to update the ffi tests that call to this. Everything besides that is looking good. Ping me when the ffi stuff is ready :)

@zachschuermann zachschuermann merged commit 72b585d into delta-io:main Feb 19, 2025
19 of 21 checks passed
@zachschuermann zachschuermann deleted the visit-schema-ffi branch February 19, 2025 16:53
zachschuermann added a commit that referenced this pull request Feb 21, 2025
## What changes are proposed in this pull request?
This PR removes the old `visit_snapshot_schema` introduced in #683 - we
should just go ahead and do the 'right thing' with having a
`visit_schema` (introduced in the other PR) and a `logical_schema()`
function (added here) in order to facilitate visiting the snapshot
schema. Additionally I've moved the schema-related things up from `scan`
module to top-level in ffi crate. Exact changes listed below; this PR
updates tests/examples to leverage the new changes.

### This PR affects the following public APIs

1. Remove `visit_snapshot_schema()` API
2. Add a new `logical_schema(snapshot)` API so you can get the schema of
a snapshot and use the `visit_schema` directly
3. Renames `free_global_read_schema` to just `free_schema`
4. Moves `SharedSchema` and `free_schema` up from `mod scan` into
top-level `ffi` crate.


## How was this change tested?
existing UT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Change that will require a version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants