Uh oh!
There was an error while loading. Please reload this page.
Add support for DuckDB struct literal syntax - #1194
Conversation
Uh oh!
There was an error while loading. Please reload this page.
You can ask the question in issue. The PR draft doesn't send the notification. Let me reference the PR apache/datafusion#9743 |
Pull Request Test Coverage Report for Build 8480512054Details
💛 - Coveralls |
alamb
commented
Mar 27, 2024
I think given the difference in syntax, having a new struct like Thank you again for working on this @gstvg and @jayzhan211 |
gstvg
commented
Mar 29, 2024
thanks @jayzhan211 and @alamb I tried adding supporting for DuckDB |
I don't understand what you mean by Snowflake-only JsonAccess with colon
I think we have not yet supported any. |
Sure. I would like to solve all this at once, to be honest. Snowflake JSON access uses
DuckDB maps key can be any type, not only strings, but may have different set of keys for each row
To support any type of key, I used Currently, because of the following arms in parse_infix and get_next_precedence, when If those two arms are moved to the Snowflake dialect, or conditioned to a I didn't find any other way to do that I've pushed it to another branch if you have interest
Sorry, I mean the |
Others dialects that uses this syntax: Snowflake ClickHouse |
How about considering
|
jayzhan211
commented
Mar 29, 2024
I met the issue while trying out my idea #1197 |
alamb
left a comment
There was a problem hiding this comment.
I think this looks good to me: the use of parse_expr and restricting it to DuckDB makes sense to me
If/When people need support for this type in Snowflake and the other dialects, I think we can handle them separately
alamb
commented
Mar 29, 2024
I also pushed d9d16ce to fix the doc test failues |
alamb
commented
Mar 29, 2024
@jayzhan211 does this change look good for you? |
jayzhan211
commented
Mar 29, 2024
I think either struct and map and other dictionaries like syntax |
alamb
commented
Mar 29, 2024
Thanks @jayzhan211 and @gstvg ! |
gstvg
commented
Mar 29, 2024
Good idea. But making Dictionary a |
jayzhan211
commented
Mar 30, 2024
It looks good to me. |
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>




Fixes#1129
Existing Struct expression supports the BigQuery semantics, which allow for optionally typed fields, that if typed, also have an optional name.
DuckDB has incompatible semantics: only named fields without any type specification.
Should I create a separate expression, perharps
NamedFieldsStruct, or change theStructto have an inner enumStruct(enum { MaybeTyped(...), Named(...) })?Thanks!