Skip to content

Commit facf917

Browse files
authored
Merge pull request #25 from fishtown-analytics/fix/090-compat-union
make the union macro work with dbt 090
2 parents 7efdedd + 32d40e3 commit facf917

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

macros/sql/union.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99

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

12-
{%- set table_parts = table.split('.') %}
12+
{%- if table.name -%}
13+
{%- set schema, table_name = table.schema, table.name -%}
14+
{%- else -%}
15+
{%- set schema, table_name = (table | string).split(".") -%}
16+
{%- endif -%}
1317

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

1721
{# update the list of columns in this table #}

0 commit comments

Comments
 (0)