Skip to content

Commit 830175f

Browse files
authored
Use adapter.quote() for get_table_types_sql (#636)
1 parent 77dcf2e commit 830175f

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

macros/sql/get_table_types_sql.sql

+2-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
when 'EXTERNAL TABLE' then 'external'
99
when 'MATERIALIZED VIEW' then 'materializedview'
1010
else lower(table_type)
11-
end as "table_type"
11+
end as {{ adapter.quote('table_type') }}
1212
{% endmacro %}
1313

1414

@@ -18,14 +18,5 @@
1818
when 'FOREIGN' then 'external'
1919
when 'MATERIALIZED VIEW' then 'materializedview'
2020
else lower(table_type)
21-
end as "table_type"
21+
end as {{ adapter.quote('table_type') }}
2222
{% endmacro %}
23-
24-
{% macro bigquery__get_table_types_sql() %}
25-
case table_type
26-
when 'BASE TABLE' then 'table'
27-
when 'EXTERNAL TABLE' then 'external'
28-
when 'MATERIALIZED VIEW' then 'materializedview'
29-
else lower(table_type)
30-
end as `table_type`
31-
{% endmacro %}

macros/sql/get_tables_by_pattern_sql.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}
77

88
select distinct
9-
table_schema as "table_schema",
10-
table_name as "table_name",
9+
table_schema as {{ adapter.quote('table_schema') }},
10+
table_name as {{ adapter.quote('table_name') }},
1111
{{ dbt_utils.get_table_types_sql() }}
1212
from {{ database }}.information_schema.tables
1313
where table_schema ilike '{{ schema_pattern }}'

0 commit comments

Comments
 (0)