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

fix(duckdb): support postgres JSON/JSONB_OBJECT_AGG to duckdb JSON_GROUP_OBJECT #4677

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

geooo109
Copy link
Collaborator

Fixes #4667

duckdb only supports the JSON_GROUP_OBJECT aggregate function (JSONB isn't supported), thus for both
JSON/JSONB_OBJECT_AGG cases the mapping is the JSON_GROUP_OBJECT function.

Moreover, the roundtrip for the postgres JSON/JSONB_OBJECT_AGG is preserved.

DOCS
DuckDB JSON_GROUP_OBJECT | Postgres JSON/JSONB_OBJECT_AGG

@geooo109 geooo109 changed the title fix(duckdb): support postgres JSON/JSONB_OBJECT_AGG to duckdb JSON_GROUP_OBJECT #4667 fix(duckdb): support postgres JSON/JSONB_OBJECT_AGG to duckdb JSON_GROUP_OBJECT Jan 29, 2025
tests/dialects/test_postgres.py Outdated Show resolved Hide resolved
sqlglot/dialects/postgres.py Outdated Show resolved Hide resolved
sqlglot/expressions.py Outdated Show resolved Hide resolved
@georgesittas georgesittas merged commit df75edd into main Jan 29, 2025
7 checks passed
@georgesittas georgesittas deleted the geooo109/duckdb_json_group_object branch January 29, 2025 16:37
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.

Bug in JSONB_OBJECT_AGG translation from postgres to duckdb
3 participants