Skip to content

Commit

Permalink
Fix bug in redshift unnest
Browse files Browse the repository at this point in the history
  • Loading branch information
rlh1994 committed Jan 29, 2024
1 parent f33dda7 commit c26bda8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions macros/utils/cross_db/unnest.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

0 comments on commit c26bda8

Please sign in to comment.