datafusion-contrib / datafusion-contrib/datafusion-functions-json
optimise `json_get(...) is null` to `json_contains_not_null(...)`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 62
- Forks
- 33
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 9
Description
We can't replace json_get(x, y) is null with NOT json_contains(x, y) because
select json_get('{"foo": null}', 'foo') is null -- true
select not json_contains('{"foo": null}', 'foo') -- false
-- or equivilantly
select json_get('{"foo": null}', 'foo') is not null -- false
select json_contains('{"foo": null}', 'foo') -- true
So we need a new method json_contains_not_null which is true if the value exists in the JSON, but is not null.
Then we can do the substitution.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing json_get and json_contains implementations and their surrounding function registration or dispatch code. Compare their handling of JSON null values, then verify that json_contains_not_null distinguishes an existing null from a missing value and supports the intended substitution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100