forked from delta-io/delta-kernel-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
[POC] Expose PlanExecutor through FFI #2
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
Draft
kyli87
wants to merge
4
commits into
kyli/plan-migration-v0-scan
Choose a base branch
from
kyli/plan-migration-v0-ffi
base: kyli/plan-migration-v0-scan
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
408fe13
feat: setup FFI stubs for building plan based default engine
kyli87 7e02af9
Flesh out iterator appoach for returning PlanResult from Java
kyli87 bd54df8
Fix java-side memory management by allowing free func on PlanResult
kyli87 e2a80e9
Temp workaround for communicating errors:
kyli87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package delta_kernel_ffi.plan; | ||
|
|
||
| // Wire format for delta_kernel::plan::DeclarativePlanNode. | ||
| // | ||
| // Mirrors the Rust enum variants. Used to ferry plan nodes from Rust to a | ||
| // non-Rust executor (e.g. Java) over FFI as serialized bytes. | ||
|
|
||
| // File format for a Scan operation. Mirrors delta_kernel::plan::ScanFileFormat. | ||
| enum ScanFileFormat { | ||
| SCAN_FILE_FORMAT_UNSPECIFIED = 0; | ||
| SCAN_FILE_FORMAT_PARQUET = 1; | ||
| SCAN_FILE_FORMAT_JSON = 2; | ||
| } | ||
|
|
||
| // File metadata; mirrors delta_kernel::FileMeta. Path is a fully qualified URL. | ||
| message FileMeta { | ||
| string location = 1; | ||
| int64 last_modified = 2; | ||
| uint64 size = 3; | ||
| } | ||
|
|
||
| // Optional half-open byte range [start, end). Mirrors `std::ops::Range<u64>`. | ||
| message ByteRange { | ||
| uint64 start = 1; | ||
| uint64 end = 2; | ||
| } | ||
|
|
||
| // File slice; mirrors `delta_kernel::FileSlice = (Url, Option<Range<u64>>)`. | ||
| message FileSlice { | ||
| string url = 1; | ||
| ByteRange range = 2; // unset = read whole file | ||
| } | ||
|
|
||
| // List files at the given URL. | ||
| message FileListing { | ||
| string url = 1; | ||
| } | ||
|
|
||
| // Read raw bytes from one or more file slices. | ||
| message ReadBytes { | ||
| repeated FileSlice files = 1; | ||
| } | ||
|
|
||
| // Write raw bytes to a file at the given URL. | ||
| message WriteBytes { | ||
| string url = 1; | ||
| bytes data = 2; | ||
| bool overwrite = 3; | ||
| } | ||
|
|
||
| // HEAD request for a single file. | ||
| message HeadFile { | ||
| string url = 1; | ||
| } | ||
|
|
||
| // Read and parse structured data files (Parquet or JSON). | ||
| // | ||
| // physical_schema_json is a JSON-serialized delta_kernel::schema::StructType (the standard | ||
| // kernel schema serialization). predicate is intentionally opaque for now and may be empty; | ||
| // a future revision will define a structured predicate message. | ||
| message Scan { | ||
| ScanFileFormat format = 1; | ||
| repeated FileMeta files = 2; | ||
| string physical_schema_json = 3; | ||
| bytes predicate = 4; // TODO: structured predicate; opaque for now | ||
| } | ||
|
|
||
| // Top-level declarative plan node. Exactly one of the `op` fields is set. | ||
| message DeclarativePlanNode { | ||
| oneof op { | ||
| FileListing file_listing = 1; | ||
| ReadBytes read_bytes = 2; | ||
| WriteBytes write_bytes = 3; | ||
| HeadFile head_file = 4; | ||
| Scan scan = 5; | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proto is the most convenient option for passing plan nodes across FFI, however we need to figure out how to keep the proto in sync between Rust and Java (i.e some way for Java side to import the proto?)