dbtsai opened a new pull request, #396: URL: https://github.com/apache/spark-connect-rust/pull/396
### What changes were proposed in this pull request? Normalize Arrow map storage fields to `entries`, `key`, and `value` before serializing local input or uploading chunked artifacts. Checked reconstruction preserves existing value, offset, and validity buffers, field metadata, nullability, ordering flags, and slices. Inputs that need no schema changes reuse their batches. This runs at the shared Arrow-import boundary, including Rust batch/row input and Python Arrow-table input. The internal IPC bridge also applies it when decoding larger input for chunking; raw `LogicalPlan::LocalRelation` byte constructors remain transparent. ### Why are the changes needed? [SPARK-61212](https://issues.apache.org/jira/browse/SPARK-61212): Arrow Rust's default `MapBuilder` names its children `keys` and `values`. Spark Java looks them up as `key` and `value`, so a nonempty local map can fail with an `ArrowColumnVector.MapAccessor` null-pointer exception. The mismatch also appears in nested maps and empty IPC schemas. ### Does this PR introduce _any_ user-facing change? Yes. Default and custom-named Arrow map inputs now use Spark-compatible storage names. Reconstructed columns are checked against their schema; incompatible child types or union ordering fail before configuration or upload RPCs. IPC serialization is still required for transport. ### How was this patch tested? - 509 Rust library tests passed, including new nested/sliced map, buffer-sharing, schema-mismatch, and safe malformed-union regressions. - Four live Rust tests passed against Spark 4.2: the existing array-literal tests and new map tests covering inline input, multiple chunk artifacts, nested/null/empty/Unicode values, and zero rows. Both new map tests fail on unpatched base `925dc876f63f1f779fe176f62575a0aa96cc6886`. - All integration tests and the `wasm-udf` test configuration compile in release mode; formatting and scoped library/new-test Clippy pass. - Full-workspace Clippy has existing approximate-constant test errors and denied PyO3 warnings, reproduced on the unpatched base. The patch introduces none of those errors; all-target checking with advisory lint severity passes. The last documentation-only edits do not change the tested implementation. No Python API-parity or performance claim is made. ### 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]
