diff --git a/patterns/unnest_data.malloynb b/patterns/unnest_data.malloynb index 2c17dd0..7398741 100644 --- a/patterns/unnest_data.malloynb +++ b/patterns/unnest_data.malloynb @@ -1,6 +1,10 @@ >>>markdown # Unnesting Data -Malloy can naturally read unnested data. Currently there is no mechanism to join something that unnest so for now you have to do it in SQL +Malloy can naturally read array data when it is in a source. Currently there is no mechanism to join an array in the Malloy language so we can drop into to SQL to do this. + +In the source below we add a column that is based on the `SPLIT` function that returns an array. When Malloy looks at the SQL for this query, it sees an array and adds as a nested join. In this case we are looking at the words that appear in the 'CITY' column. + +SQL is optimized so if this column isn't used in a subsequent query, it is not computed. >>>malloy source: airports is duckdb.sql(""" SELECT