Skip to content

Conversation

lnkuiper
Copy link
Contributor

Following a comment here, I've decided to take a closer look at the NULL handling and return types of JSON extraction functions in PostgreSQL and BigQuery, and found that we were inconsistent:

  1. While json_extract/-> should return a JSON null value when doing, e.g., SELECT '{"duck": null}'->'duck';, json_extract_string/->>/json_value should return a SQL NULL value.
  2. The return type of json_value should be VARCHAR, not JSON.

Both points were not implemented correctly in DuckDB, which this PR fixes.

@Mytherin Mytherin merged commit 1c42e48 into duckdb:main Sep 19, 2024
38 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

github-actions bot pushed a commit to duckdb/duckdb-r that referenced this pull request Sep 27, 2024
Fix duckdb/duckdb#13993 - avoid disabling optimizers for SET VARIABLE (duckdb/duckdb#14028)
Proper NULL handling in special json extraction functions (duckdb/duckdb#14032)
Adds Julia support for scalar UDFs (duckdb/duckdb#14024)
github-actions bot added a commit to duckdb/duckdb-r that referenced this pull request Sep 27, 2024
Fix duckdb/duckdb#13993 - avoid disabling optimizers for SET VARIABLE (duckdb/duckdb#14028)
Proper NULL handling in special json extraction functions (duckdb/duckdb#14032)
Adds Julia support for scalar UDFs (duckdb/duckdb#14024)

Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants