dbtsai opened a new pull request, #430: URL: https://github.com/apache/spark-connect-rust/pull/430
### What changes were proposed in this pull request? Jira: [SPARK-61269](https://issues.apache.org/jira/browse/SPARK-61269). Add an exact built-in `int` branch to the Rust scalar-to-Column conversion used by expressions such as `F.col("id") == 5`. Values within the signed 64-bit range directly produce integer or long literals, using the existing signed 32-bit boundary. Consolidate that literal classification in one helper. Boolean values, integer subclasses, `IntEnum`, NumPy scalars and out-of-range integers retain the generic conversion path. Add wire-boundary, boolean and probe-sentinel regression tests. ### Why are the changes needed? Exact integer operands currently repeat generic enum, NumPy and nonprimitive scalar checks during expression construction. Their exact Python type and integer value provide the information needed to construct the literal directly. Two preplanned local fake-server runs compared the same patch with Rust master at `0ac7a0f4e8c98a2d13157175b20c9ebb3c536c28`. Each run used 45 fresh-process samples per client and case across 12 cases; the runs were evaluated separately. | Expression construction target | Run A, master → patch | Run B, master → patch | | --- | --- | --- | | Wall time per operation | 0.580084 → 0.505625 ms (−12.84%) | 0.573583 → 0.516083 ms (−10.02%) | | CPU time per operation | 0.313 → 0.262 ms (−16.29%) | 0.318 → 0.265 ms (−16.67%) | All measured regression guards passed in both runs. These are exploratory local measurements: the original same-binary control remained noise-uncertain, the full benchmark catalog was not completed, and they establish no general or separately accepted memory improvement. The comparison is with the pinned master revision above; it has not been repeated against the current target branch. ### Does this PR introduce _any_ user-facing change? Yes. Expressions with exact built-in integer operands avoid repeated scalar-type probes. Literal wire types and overflow behavior are preserved. ### How was this patch tested? - Added tests for signed 32-bit/64-bit wire boundaries, integer subclasses, `IntEnum`, boolean literal types and exact-integer probe avoidance. The probe-sentinel test passed on the patch and failed at the intended plain-integer comparison on the pinned master. - `test_dropin_offline.py` and `test_arrow_handoff.py`: 2,589 passed, eight `SPARK_REMOTE`-dependent tests skipped, zero failures/errors. The separate unchanged `test_ml_offline.py` module passed all 72 tests. - Release Rust library tests: 495 passed. Integration and WebAssembly targets compiled with `--no-run`; formatting checks passed. - Four selected native live tests passed for the candidate and the same four passed for the official reference on Spark 4.3.0. Full native/API/official parity, full benchmark holdout and required CI coverage remain incomplete. - Workspace Clippy exited 101 with 140 errors and 297 warnings. The 38 diagnosed files matched the pinned master source; master Clippy was not separately executed. This is a non-green result. The local tests and measurements above apply to the unchanged patch on pinned base `0ac7a0f4e8c98a2d13157175b20c9ebb3c536c28`. Current upstream master `8768cc4f780c7fb144e0b7a72ed5d5be14005023` is 35 commits ahead. The production conversion file is unchanged upstream and this two-file patch applies cleanly; a merged-base build/test and upstream CI have not been run. ### 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]
