Skip to content

Commit

Permalink
removing get_catalog()
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin-Thakur committed Dec 22, 2023
1 parent 607f5f6 commit ebe59ab
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions dbt/include/vertica/macros/adapters/metadata.sql
Original file line number Diff line number Diff line change
@@ -1,56 +1,3 @@
{% macro d__get_catalog99(information_schema, schemas) -%}
{% call statement('get_catalog99', fetch_result=True) %}

select
'{{ information_schema.database }}' table_database
, tab.table_schema
, tab.table_name
, 'TABLE' table_type
, comment table_comment
, tab.owner_name table_owner
, col.column_name
, col.ordinal_position column_index
, col.data_type column_type
, nullif('','') column_comment
from v_catalog.tables tab
join v_catalog.columns col on tab.table_id = col.table_id
left join v_catalog.comments on tab.table_id = object_id
where not(tab.is_system_table) and
(
{%- for schema in schemas -%}
lower(tab.table_schema) = lower('{{ schema }}') {%- if not loop.last %} or {% endif %}
{%- endfor -%}
)
union all
select
'{{ information_schema.database }}' table_database
, vw.table_schema
, vw.table_name
, 'VIEW' table_type
, comment table_comment
, vw.owner_name table_owner
, col.column_name
, col.ordinal_position column_index
, col.data_type column_type
, nullif('','') column_comment
from v_catalog.views vw
join v_catalog.view_columns col on vw.table_id = col.table_id
left join v_catalog.comments on vw.table_id = object_id
where not(vw.is_system_view) and
(
{%- for schema in schemas -%}
lower(vw.table_schema) = lower('{{ schema }}') {%- if not loop.last %} or {% endif %}
{%- endfor -%}
)
order by table_schema, table_name, column_index

{% endcall %}
{{ return(load_result('get_catalog00').table) }}
{% endmacro %}







Expand Down

0 comments on commit ebe59ab

Please sign in to comment.