dbtsai opened a new pull request, #474: URL: https://github.com/apache/spark-connect-rust/pull/474
### What changes were proposed in this pull request? Add an experimental Rust Spark Connect frontend embedded in a Spark JVM through JNI. Rust owns the gRPC listener, request decoding, protocol sessions, operations and response streams. A direct engine adapter invokes Spark planning and execution APIs inside that JVM. The patch adds opt-in, unpublished server/JNI crates, a Java host, runnable official Rust and PySpark client examples, protocol and lifecycle tests, and native CI. Arrow vector value buffers cross JNI through the Arrow C Data Interface with explicit Java owner retention; Arrow IPC and gRPC still serialize results. ### Why are the changes needed? This WIP explores reusing the Rust protocol and transport stack as an embedded server frontend while Spark remains the execution engine. It provides a runnable implementation for discussing the engine boundary, ownership and shutdown behavior. JIRA: https://issues.apache.org/jira/browse/SPARK-61384 ### Does this PR introduce _any_ user-facing change? Yes: developers can explicitly build and launch the embedded prototype. Existing default workspace members and client APIs are unchanged. The prototype is limited to trusted local workloads and a subset of batch queries, result types and RPCs. Unsupported RPCs return `UNIMPLEMENTED`. Authentication, authorization, TLS, full protocol parity, production resource governance, Windows and JNI library unloading are outside this WIP. The README documents these limits. The Java adapter uses internal Spark APIs. Local acceptance used Spark `4.2.0-SNAPSHOT` with assembly-reported build revision `250ccca3f2b5f043e20b415adf17bda5d202c60f`, Scala 2.13 and JDK 21. The repository tracks protocol 4.3.0; this does not establish compatibility with a Spark 4.3.0 assembly. ### How was this patch tested? Final native and live validation used official Rust 1.88.0 and JDK 21 from a frozen source snapshot. Unchanged-client release checks used Rust 1.99.1: - 62 Rust server/JNI tests; strict native Clippy and workspace rustfmt. - C Arrow ownership tests, including AddressSanitizer and UndefinedBehaviorSanitizer. - Java compilation and direct engine, vector ownership and lifecycle checks under `-Xcheck:jni`. - 38 official PySpark/raw gRPC acceptance checks and the official Rust client example against the embedded listener; JVM listener ownership, synchronous shutdown and port closure verified. - 12 acceptance-runner guard tests; 24 upstream tooling tests with two existing skips. - 567 unchanged client release unit tests; compilation of all client integration tests with and without `wasm-udf`. Workspace-wide Clippy remains advisory upstream. It reports the same 12 `approx_constant` errors at the same unchanged client file/line locations on this patch and exact base `729a7a36157841de9b90279cf557ed5d536a2d84`. Strict Clippy for the new crates passes. Native tests and strict Clippy also passed locally on Rust 1.88; live Java/JNI acceptance requires a compatible locally selected Spark assembly and is separate from that workflow. Exact native library, Java jar, Rust example and Spark assembly hashes were recorded before and after the live run. Reproduction commands and assembly requirements are in `crates/spark-connect-server/README.md`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex This pull request and its description were written by OpenAI Codex. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
