Skip to content

Commit

Permalink
Merge pull request dbt-labs#25 from fishtown-analytics/fix/090-compat…
Browse files Browse the repository at this point in the history
…-union

make the union macro work with dbt 090
  • Loading branch information
drewbanin authored Nov 5, 2017
2 parents 7efdedd + 32d40e3 commit facf917
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions macros/sql/union.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@

{%- set _ = table_columns.update({table: []}) %}

{%- set table_parts = table.split('.') %}
{%- if table.name -%}
{%- set schema, table_name = table.schema, table.name -%}
{%- else -%}
{%- set schema, table_name = (table | string).split(".") -%}
{%- endif -%}

{%- set cols = adapter.get_columns_in_table(*table_parts) %}
{%- set cols = adapter.get_columns_in_table(schema, table_name) %}
{%- for col in cols -%}

{# update the list of columns in this table #}
Expand Down

0 comments on commit facf917

Please sign in to comment.