-
Notifications
You must be signed in to change notification settings - Fork 99
Add jsonb[] array type pushdown support #286
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
base: main
Are you sure you want to change the base?
Changes from all commits
05d6955
2b6cd3b
7fbe14d
cb4b6e9
6a51e05
0118be3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1221,6 +1221,19 @@ is_foreign_pathkey(PlannerInfo *root, | |
| static char * | ||
| deparse_type_name(Oid type_oid, int32 typemod) | ||
| { | ||
| /* | ||
| * DuckDB does not have a jsonb[] type. Map it to json[] which DuckDB | ||
| * understands. We do this at deparse time rather than rewriting OIDs | ||
| * in the expression tree, because changing OIDs would break operator | ||
| * and function lookup. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't the real deparse though, we still parse the output of this (foreignscan case). Not sure I understand the effect of this.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm just giving Claude a chance to bang its head against this for a bit, so it could definitely be a bit offbase here. (I guess I'll make this a draft so you don't waste your time on it until things are happy.) |
||
| * | ||
| * Scalar jsonb is handled differently: rewrite_query.c wraps jsonb | ||
| * expressions in __lake__internal__nsp__.jsonb() function calls, so | ||
| * we do not need to remap JSONBOID here. | ||
| */ | ||
| if (type_oid == JSONBARRAYOID) | ||
| type_oid = JSONARRAYOID; | ||
|
|
||
| bits16 flags = FORMAT_TYPE_TYPEMOD_GIVEN; | ||
|
|
||
| if (!is_builtin(type_oid)) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks messy. How do we map JSONB to JSON? Seems like we'd want to do the same thing here?
Iirc we create an alias in DuckDB, so do we actually need to do anything special for arrays w.r.t. deparsing/rewriting?