HyukjinKwon opened a new pull request, #315: URL: https://github.com/apache/spark-connect-rust/pull/315
### What changes were proposed in this pull request? [SPARK-61119](https://issues.apache.org/jira/browse/SPARK-61119): The array literals of the Rust core carry the type of their elements, as PySpark's do. `LiteralExpression::Array::to_proto` set the elements of `Literal.Array`, but not its `element_type`. It now sets it, as PySpark's `LiteralExpression.to_plan` does, also for the arrays nested in an array. The field is deprecated in the proto in favor of the `data_type` of the literal, but it is what PySpark 4.3.0 writes and what the server reads. ### Why are the changes needed? A Spark 4.3.0 server rejects an array literal without an element type, also one of elements, with `CONNECT_INVALID_PLAN.ARRAY_LITERAL_MISSING_DATA_TYPE`. So every column of `Expression::literal(LiteralExpression::Array { .. })` of the Rust API failed on the server. The Python client builds arrays with the `array` function, so it was not affected. ### Does this PR introduce _any_ user-facing change? Yes, for users of the Rust API: array literals work on the server. ### How was this patch tested? - New Rust tests (`array_literal.rs`): - the element type of an empty array literal, and of a nested array and of its elements - against the server, a DataFrame of an array literal of elements and an empty one of strings, of the schema `struct<a:array<int>,e:array<string>>` Both fail without this change, the live one with `ARRAY_LITERAL_MISSING_DATA_TYPE`. - The unit test of the proto of an array literal checks its element type. - The lib tests of both crates (590 passed), the build of all tests, also with `wasm-udf`, the offline Python suites (2165 passed, 8 skipped), and the live drop-in and Arrow suites (173 passed) and live cases (10 passed) against a local Spark 4.3.0 server. Clippy reports no diagnostics in the changed lines. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 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]
