Skip to content

Extracting a key that is null in json returns a non-null value #6779

@kemiller

Description

@kemiller

What happens?

When extracting from json, if a key in the json has a null value, it's returned as a non-null object in SQL. This is not what I would expect at all, and breaks things like COALESCE.

image

image

To Reproduce

Pretty easy to see what I mean by running this snippet:

select json_extract('{ "foo": null }', '$.foo') is null;

OS:

macOS / m1

DuckDB Version:

v0.7.1 b00b93f

DuckDB Client:

CLI & typescript

Full Name:

Ken Miller

Affiliation:

Watershed

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions