Skip to content

Commit

Permalink
Handle external tables in get_tables_by_pattern_sql (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
upjohnc authored and clrcrl committed May 18, 2021
1 parent 10cc5d2 commit e77db79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@

## Fixes
* Handle booleans gracefully in the unpivot macro ([#305](https://github.com/fishtown-analytics/dbt-utils/pull/305) [@avishalom](https://github.com/avishalom))
* Fix a bug in `get_relation_by_prefix` that happens with Snowflake external tables. Now the macro will retrieve tables that match the prefix which are external tables ([#350](https://github.com/fishtown-analytics/dbt-utils/issues/350))
## Under the hood


# dbt-utils v0.6.4

### Fixes
Expand Down
2 changes: 2 additions & 0 deletions macros/sql/get_tables_by_pattern_sql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
table_name as "table_name",
case table_type
when 'BASE TABLE' then 'table'
when 'EXTERNAL TABLE' then 'external'
when 'MATERIALIZED VIEW' then 'materializedview'
else lower(table_type)
end as "table_type"
from {{ database }}.information_schema.tables
Expand Down

0 comments on commit e77db79

Please sign in to comment.