-
Notifications
You must be signed in to change notification settings - Fork 567
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
Add support for DuckDB struct literal syntax #1194
Conversation
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 |
I think given the difference in syntax, having a new struct like Thank you again for working on this @gstvg and @jayzhan211 |
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
|
I met the issue while trying out my idea #1197 |
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.
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
I also pushed d9d16ce to fix the doc test failues |
@jayzhan211 does this change look good for you? |
I think either struct and map and other dictionaries like syntax |
Thanks @jayzhan211 and @gstvg ! |
Good idea. But making Dictionary a
|
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 theStruct
to have an inner enumStruct(enum { MaybeTyped(...), Named(...) })
?Thanks!