crm26 opened a new pull request, #21353:
URL: https://github.com/apache/datafusion/pull/21353

   ## Summary
   
   Adds a new `datafusion-functions-json` crate to the workspace with 
`json_get_str` as the initial function, establishing the integration pattern 
for bringing JSON functions into core DataFusion.
   
   Per @alamb's suggestion in #21301:
   > Perhaps we could make it smaller -- like one that implements scaffolding / 
new crate / etc and one function. And then we can add the other functions as 
follow on PRs
   
   ## What's included
   
   - New crate `datafusion/functions-json/` with `register_all()` hook
   - `json_get_str(json, *keys) -> str` — extracts a string value from a JSON 
string at the given path (supports nested keys and array indices)
   - Optional feature flag `json_expressions` on the core crate (not enabled by 
default)
   - Handles `Utf8`, `LargeUtf8`, and `Utf8View` string types
   - Minimum 2 args enforced at planning time via `coerce_types`
   - sqllogictest coverage (`json_functions.slt`)
   - 9 unit tests + 1 doctest
   
   ## Design notes
   
   - Uses `serde_json` (already a workspace dependency) for JSON parsing. The 
existing `datafusion-contrib/datafusion-functions-json` crate uses `jiter` for 
better performance — follow-on PRs can switch the implementation while keeping 
the same interface.
   - Feature flag is `json_expressions`, matching the pattern of 
`nested_expressions`, `unicode_expressions`, etc.
   - Registration wired through `session_state_defaults.rs`, same as other 
function crates.
   
   ## Follow-on PRs
   
   Will add the remaining functions from `datafusion-functions-json`: 
`json_get`, `json_get_int`, `json_get_float`, `json_get_bool`, `json_get_json`, 
`json_get_array`, `json_as_text`, `json_length`, `json_contains`, and `->` / 
`->>` operators.
   
   Ref: #21301


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