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
select id, f.value::varchar as v, f.index as i
from (select column1 as id, column2 as col from (values (1, 's1,s2,s3'), (2, 's1,s2'))) as t
, lateral flatten(input => split(t.col, ',')) as f order by id;
Rewritten SQL:
SELECT ID, F.VALUE ->> '$' AS V, F.INDEX AS I FROM (SELECT COLUMN1 AS ID, COLUMN2 AS COL FROM (VALUES (1, 's1,s2,s3'), (2, 's1,s2')) AS _("COLUMN1", "COLUMN2")) AS T, LATERAL UNNEST(CAST(TO_JSON(STR_SPLIT(T.COL, ',')) AS JSON[])) AS F(VALUE) ORDER BY ID;
Error:
snowflake.connector.errors.ProgrammingError: 002043 (02000): None: Binder Error: Table "F" does not have a column named "INDEX"
SQL:
Rewritten SQL:
Error:
Version: main
DuckDB docs recommends extra SELECT with generate_subscripts: https://duckdb.org/docs/sql/query_syntax/unnest.html#keeping-track-of-list-entry-positions
The text was updated successfully, but these errors were encountered: