diff --git a/dbt/include/vertica/macros/adapters/metadata.sql b/dbt/include/vertica/macros/adapters/metadata.sql index e44d082..f7ec6f2 100644 --- a/dbt/include/vertica/macros/adapters/metadata.sql +++ b/dbt/include/vertica/macros/adapters/metadata.sql @@ -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 %} - - - -