From c26bda8955b0f989f2fe096bd21a6e5d351e2dcb Mon Sep 17 00:00:00 2001 From: Ryan Hill Date: Mon, 29 Jan 2024 14:10:33 +0000 Subject: [PATCH] Fix bug in redshift unnest --- macros/utils/cross_db/unnest.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros/utils/cross_db/unnest.sql b/macros/utils/cross_db/unnest.sql index 9a35b338..888ad71f 100644 --- a/macros/utils/cross_db/unnest.sql +++ b/macros/utils/cross_db/unnest.sql @@ -38,6 +38,6 @@ You may obtain a copy of the Snowplow Personal and Academic License Version 1.0 {% endmacro %} {% macro redshift__unnest(id_column, unnest_column, field_alias, source_table, with_index=false) %} - select {{ id_column }}, {{ field_alias }} {% if with_index %} , index as source_index - from {{ source_table }} p, p.{{ unnest_column }} as {{ field_alias }} at index {% endif %} + select {{ id_column }}, {{ field_alias }} {% if with_index %} , index as source_index {% endif %} + from {{ source_table }} p, p.{{ unnest_column }} as {{ field_alias }}{% if with_index %} at index {% endif %} {% endmacro %}