Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ models:
+materialized: table
tmp:
+materialized: view

quoting:
database: false
schema: true
identifier: true

vars:
github:
issue_assignee: "{{ source('github', 'issue_assignee') }}"
Expand Down
18 changes: 16 additions & 2 deletions macros/union/github_union_connections.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,23 @@
{{ '-- identifier: ' ~ identifier ~ '\n' }}

{% if relation is not none -%}
{%- set source_rel = source(single_source_name, single_table_name) -%}
{%- set source_cols = adapter.get_columns_in_relation(source_rel) -%}
{%- set ns = namespace(has_case_sensitive_cols=false) -%}
{%- if target.type == 'snowflake' -%}
{%- for col in source_cols -%}
{%- if col.name != col.name | upper -%}{%- set ns.has_case_sensitive_cols = true -%}{%- endif -%}
{%- endfor -%}
{%- endif -%}
select
{{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}
from {{ source(single_source_name, single_table_name) }} as source_table
{% if ns.has_case_sensitive_cols %}
{%- for col in source_cols %}
{{ adapter.quote(col.name) }} as {{ col.name }}{% if not loop.last %},{% endif %}
{% endfor %}
{% else %}
{{ dbt_utils.star(from=source_rel) }}
{% endif %}
from {{ source_rel }} as source_table

{% else %}
{{ exceptions.warn(exception_warning) if using_empty_table_warnings }}
Expand Down