dbtsai opened a new pull request, #155: URL: https://github.com/apache/spark-connect-rust/pull/155
### What changes were proposed in this pull request? [SPARK-60917](https://issues.apache.org/jira/browse/SPARK-60917) reduces the client cost of uploading cached Arrow input. Enable the `sha2` assembly feature on non-Windows aarch64 targets, retaining CPU feature detection and software fallback. Move serialized cache blobs into shared `Bytes` and construct upload frames as the transport consumes them. The cache path retains the existing 32 KiB framing, small-artifact batching, hash names, duplicate ordering, cache checks, CRC validation and acknowledgement checks. The generic file-artifact builder keeps its existing behavior. ### Why are the changes needed? `sha2` 0.10 uses software SHA-256 on aarch64 without the assembly feature. The cache upload path also clones in-memory IPC data when opening artifact readers and eagerly copies all request payloads before starting the RPC. Shared buffers and lazy framing remove those extra payload allocations. In a local five-sample comparison with accelerated SHA in both native clients, 136 MB Arrow input had median extra peak client RSS of **288.59 → 135.81 MiB** and median `createDataFrame` time of **404.43 → 341.43 ms**. A separate isolated hashing probe improved from approximately **302 → 53 ms** after enabling ARM acceleration. These experiments used macOS arm64, Spark 4.2.0 `local[2]` with a 3 GiB driver, Python 3.12.14 and PyArrow 26. Input/session preparation and count/eight-column-sum validation were outside the timed interval. RSS was sampled externally at a requested 2 ms interval and can miss shorter peaks. These measurements establish local creation behavior; remote-network and end-to-end query performance are unmeasured. ### Does this PR introduce _any_ user-facing change? Lower temporary memory use during cached Arrow input upload, with faster SHA-256 hashing on supported ARM CPUs. No public API change. ### How was this patch tested? - Added transport unit tests for framing equivalence and boundaries, shared payload storage, and cleanup when the stream is dropped. - 102 transport and 410 Rust API release unit tests passed. All Rust client integration targets compiled with and without `wasm-udf`; formatting and whitespace checks passed. - 420 offline/mock Python tests passed, including large cached uploads, deduplication, CRC failures and missing acknowledgements; eight live-server cases were skipped in that offline invocation. - Against a checksum-verified Spark **4.3.0** distribution: 10 native Arrow end-to-end tests, 34 live Arrow-input cases, and 33 official creation/collection parity tests passed; two official cases were skipped. The official gate was scoped to those two affected test modules. - API introspection against official PySpark 4.3.0 found only the intentionally absent `Column.to_plan` among the twelve inspected Connect classes. - Workspace Clippy still fails on existing lints in unchanged API/Python/test files. Upstream master also fails; no Clippy errors point into this PR's changed files, and all source files containing errors are byte-identical to upstream. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (application version unavailable). This pull request and its description were written by Isaac. -- 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]
