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] add spark-connect protocol #3189

Merged
merged 7 commits into from
Nov 8, 2024
Merged

[FEAT] add spark-connect protocol #3189

merged 7 commits into from
Nov 8, 2024

Conversation

andrewgazelka
Copy link
Contributor

@andrewgazelka andrewgazelka commented Nov 6, 2024

This PR adds a script-based approach for generating the Spark Connect protobuf code, eliminating the need for developers to have the protobuf compiler (protoc) installed locally.

Key changes:

  • Added a new spark-connect-script crate that uses tonic-build to compile the .proto files into Rust code at build time
  • The script outputs the generated code as a string which can then be stored directly in the codebase
  • Added the generated Rust code to src/spark-connect/src/lib.rs
  • Updated workspace members to include both new crates
  • The proto files are copied from Spark's codebase and cover the full Connect protocol including base, catalog, commands, common, expressions, relations and types

This approach makes it easier for developers to work with the Spark Connect protocol since they don't need to manage protoc installation and versioning. The generated code is checked into the repo and can be reviewed/updated as needed.

Dependencies added:

  • prost: For protobuf encoding/decoding
  • prost-types: Common protobuf type definitions
  • tonic: For gRPC functionality

@github-actions github-actions bot added the enhancement New feature or request label Nov 6, 2024
Copy link

codspeed-hq bot commented Nov 6, 2024

CodSpeed Performance Report

Merging #3189 will not alter performance

Comparing andrew/spark-connect (ab6c56b) with main (baca61e)

Summary

✅ 17 untouched benchmarks

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.90%. Comparing base (d8cdf36) to head (15ed80d).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3189      +/-   ##
==========================================
- Coverage   78.60%   77.90%   -0.71%     
==========================================
  Files         637      638       +1     
  Lines       78225    79207     +982     
==========================================
+ Hits        61491    61707     +216     
- Misses      16734    17500     +766     
Files with missing lines Coverage Δ
src/spark-connect/src/lib.rs 0.00% <ø> (ø)

... and 19 files with indirect coverage changes

@@ -0,0 +1,28 @@
fn main() -> std::io::Result<()> {
Copy link
Member

Choose a reason for hiding this comment

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

let place this crate under filepaths:

src/scripts/spark-connect-generation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

src/spark-connect/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Member

@samster25 samster25 left a comment

Choose a reason for hiding this comment

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

LGTM

@andrewgazelka andrewgazelka merged commit f566125 into main Nov 8, 2024
40 checks passed
@andrewgazelka andrewgazelka deleted the andrew/spark-connect branch November 8, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants