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

allow union input to json_get #17

Merged
merged 4 commits into from
Jun 27, 2024
Merged

allow union input to json_get #17

merged 4 commits into from
Jun 27, 2024

Conversation

samuelcolvin
Copy link
Collaborator

@samuelcolvin samuelcolvin commented Jun 21, 2024

This allows queries of the form

select json_get(json_get(json_data, 'foo'), 0) from test

These cases could be simplified, but it'll be much harder/impossible to simplify use of json unions from CTEs or other parts of the query.

Note

The above query would be much more efficient if written:

select json_get(json_data, 'foo', 0) from test

cc @dmontagu

src/common.rs Outdated Show resolved Hide resolved
src/common.rs Outdated Show resolved Hide resolved
src/common.rs Outdated Show resolved Hide resolved
src/common.rs Show resolved Hide resolved
src/common_union.rs Show resolved Hide resolved
Copy link
Collaborator

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@samuelcolvin samuelcolvin enabled auto-merge (squash) June 27, 2024 17:25
@samuelcolvin samuelcolvin merged commit 783b60b into main Jun 27, 2024
6 checks passed
@samuelcolvin samuelcolvin deleted the union-input branch June 27, 2024 17:27
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