Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typed materialized views as views #525

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# dbt-utils v0.8.3
## New features
- A macro for deduplicating data ([#335](https://github.com/dbt-labs/dbt-utils/issues/335), [#512](https://github.com/dbt-labs/dbt-utils/pull/512))
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ models:
<summary>Additional `gaps` and `zero_length_range_allowed` examples</summary>

**Understanding the `gaps` argument:**

Here are a number of examples for each allowed `gaps` argument.
* `gaps: not_allowed`: The upper bound of one record must be the lower bound of
the next record.
Expand Down Expand Up @@ -787,7 +786,7 @@ from {{ ref('my_model') }}
This macro unions together an array of [Relations](https://docs.getdbt.com/docs/writing-code-in-dbt/class-reference/#relation),
even when columns have differing orders in each Relation, and/or some columns are
missing from some relations. Any columns exclusive to a subset of these
relations will be filled with `null` where not present. An new column
relations will be filled with `null` where not present. A new column
(`_dbt_source_relation`) is also added to indicate the source for each record.

**Usage:**
Expand Down
2 changes: 1 addition & 1 deletion macros/sql/get_relations_by_pattern.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
database=database,
schema=row.table_schema,
identifier=row.table_name,
type=row.table_type
type = row.table_type
) -%}
{%- do tbl_relations.append(tbl_relation) -%}
{%- endfor -%}
Expand Down
2 changes: 1 addition & 1 deletion macros/sql/get_table_types_sql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
when 'EXTERNAL TABLE' then 'external'
when 'MATERIALIZED VIEW' then 'materializedview'
else lower(table_type)
end as "table_type"
end as table_type
{% endmacro %}


Expand Down
5 changes: 1 addition & 4 deletions macros/sql/get_tables_by_pattern_sql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
select distinct
table_schema,
table_name,
case table_type
when 'BASE TABLE' then 'table'
else lower(table_type)
end as table_type
{{ dbt_utils.get_table_types_sql() }}

from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES
where lower(table_name) like lower ('{{ table_pattern }}')
Expand Down