Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Update catalog to push filter up and make lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
clausherther committed May 4, 2021
1 parent dde2e18 commit 9546041
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions dbt/include/presto/macros/catalog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
null as "table_owner"

from {{ information_schema }}.tables
where
table_schema != 'information_schema'
and
table_schema in ('{{ schemas | join("','") | lower }}')

),

Expand All @@ -31,18 +35,16 @@
null as "column_comment"

from {{ information_schema }}.columns
where
table_schema != 'information_schema'
and
table_schema in ('{{ schemas | join("','") | lower }}')

)

select *
from tables
join columns using ("table_database", "table_schema", "table_name")
where "table_schema" != 'information_schema'
and (
{%- for schema in schemas -%}
upper("table_schema") = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}
{%- endfor -%}
)
order by "column_index"
)

Expand Down

0 comments on commit 9546041

Please sign in to comment.