andygrove opened a new pull request, #71:
URL: https://github.com/apache/datafusion-spark/pull/71

   ## Summary
   - Adds Spark's `json_array_length(jsonArray)`, ported from DataFusion 
Comet's `json_funcs/json_array_length.rs`.
   - Returns the number of elements in the outermost JSON array. NULL for a 
NULL input, empty string, invalid or truncated JSON, and valid JSON that is not 
an array.
   - Accepts `Utf8`, `LargeUtf8` and `Utf8View`. Like Spark, other types such 
as integers are rejected at planning time.
   - Adds `serde` as a direct dependency (already in the graph through 
`serde_json`) for the streaming array counter.
   
   ## Known gap
   Spark parses with Jackson, whose factory settings may accept some 
non-standard JSON that `serde_json` rejects (for example comments or 
single-quoted strings). Those inputs return NULL here. Not verified or 
addressed in this PR.
   
   ## Testing
   - Unit tests and `json/json_array_length.slt`. Expected values come from 
Spark's `json-functions.sql.out` golden file.
   - `cargo clippy --all-targets --all-features -- -D warnings`, `cargo test -p 
datafusion-spark` and `cargo test -p datafusion-spark-sqllogictest` pass.


-- 
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]

Reply via email to