-
Notifications
You must be signed in to change notification settings - Fork 706
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
snowflake object_construct is converted to duckdb map with values of single type #1699
Comments
Do you know if there's an equivalent concept in DuckDB to improve the transpilation? For example, would DuckDB's structs be more suitable here, or is there a difference in semantics? |
Yup, struct should behave as needed, I think. As |
Ok, thanks for confirming. I'll look into this a bit closer and try to fix it on Monday. |
In Snowflake, OBJECT_CONSTRUCT can be used to construct an object from the given key-value pairs. Keys must be strings, but values can be any type and can differ from each other.
When converting OBJECT_CONSTRUCT to duckdb, it ends up as a map. Maps must have a single type for all keys, and a single type for all values.
eg:
Because the map/list must be of the same type, in this example the integer
1
becomes the string"1"
when the expression is executed in duckdb:NB:
to_json
is used here to show that the value for thea
key is a string.The text was updated successfully, but these errors were encountered: