You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run actual on https://shell.duckdb.org/, you get "Conversion Error: Could not convert string 'foo' to INT32".
This is because the names of the fields is important, and the simple (ROW(1, 'foo') that is currently given as output isn't adequate for this usage.
I would expect that actual == inp. I think this should work even if the struct values are columns instead of literals, eg {'i':my_int_col, 's':my_str_col} should roundtrip exactly.
I originally found this in this ibis issue, but I think this should be fixed at the sqlglot level. Curious if you will agree.
The text was updated successfully, but these errors were encountered:
The STRUCT -> ROW transformation was added to solve a BQ -> DuckDB transpilation path, but it does seem that it's not as flexible under casts as pure structs / struct_pack. On DuckDB's docs they're listed as synonymous ways of creating structs so I'd expect that they have similar semantics under the hood.
For now, I reverted a part of the transpilation path in order to restore DuckDB's STRUCT cast roundtrip.
Fully reproducible code snippet
If you run
actual
on https://shell.duckdb.org/, you get "Conversion Error: Could not convert string 'foo' to INT32".This is because the names of the fields is important, and the simple
(ROW(1, 'foo')
that is currently given as output isn't adequate for this usage.I would expect that
actual == inp
. I think this should work even if the struct values are columns instead of literals, eg{'i':my_int_col, 's':my_str_col}
should roundtrip exactly.I originally found this in this ibis issue, but I think this should be fixed at the sqlglot level. Curious if you will agree.
The text was updated successfully, but these errors were encountered: