Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json_path_exists can't deal with null json #4865

Open
Kev1n8 opened this issue Oct 22, 2024 · 2 comments · May be fixed by #4881
Open

json_path_exists can't deal with null json #4865

Kev1n8 opened this issue Oct 22, 2024 · 2 comments · May be fixed by #4881
Labels
C-bug Category Bugs

Comments

@Kev1n8
Copy link
Contributor

Kev1n8 commented Oct 22, 2024

What type of bug is this?

Incorrect result

What subsystems are affected?

Standalone mode, Frontend

Minimal reproduce step

The recently added json_path_exists behaves wrongly when json param is null.
For example:

SELECT json_path_exists(parse_json('null'), '$.a')
SELECT json_paht_exists(parse_json('{}'),'null')

OUTPUT:
false
false

What did you expect to see?

According to JSON_PATH_MATCH, the result should be null.

What did you see instead?

Error.

What operating system did you use?

macOS 15.0.1

What version of GreptimeDB did you use?

0.9.5

Relevant log output and stack trace

No response

@Kev1n8 Kev1n8 added the C-bug Category Bugs label Oct 22, 2024
@Kev1n8
Copy link
Contributor Author

Kev1n8 commented Oct 22, 2024

I'm already working on it.

@Kev1n8
Copy link
Contributor Author

Kev1n8 commented Oct 23, 2024

As discussed at here, we will keep the param non-nullable but return null when json is parse_json('null').

@Kev1n8 Kev1n8 linked a pull request Oct 25, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant