-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor of the Code Base * Non-implemented functions return an exception
- Loading branch information
Showing
27 changed files
with
600 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# dbt-vertica Macro Implementations | ||
|
||
Below is a table for what macros the current Vertica adapter supports for dbt. This is constantly improving and changing as both dbt adds new functionality, as well as the dbt-vertica driver improves. This list is based upon dbt 1.0.3, with the list found under https://github.com/dbt-labs/dbt-core/tree/main/core/dbt/include/global_project/macros. | ||
|
||
## dbt Macros - adapters | ||
|
||
| dbt Macros - adapters | Function | Implemented | | ||
| ------------------------- | ----------------------------------- | ----------- | | ||
| adapters/columns.sql | get_columns_in_relation() | Yes | | ||
| adapters/columns.sql | sql_convert_columns_in_relation() | No | | ||
| adapters/columns.sql | get_columns_in_query() | Yes | | ||
| adapters/columns.sql | alter_column_type() | No | | ||
| adapters/columns.sql | alter_relation_add_remove_columns() | No | | ||
| adapters/freshness.sql | collect_freshness() | No | | ||
| adapters/freshness.sql | current_timestamp() | Yes | | ||
| adapters/indexes.sql | create_indexes() | Yes | | ||
| adapters/indexes.sql | get_create_index_sql() | No | | ||
| adapters/metadata.sql | get_catalog() | Yes | | ||
| adapters/metadata.sql | information_schema_name() | Yes | | ||
| adapters/metadata.sql | list_schemas() | Yes | | ||
| adapters/metadata.sql | list_relations_without_caching() | Yes | | ||
| adapters/persist_docs.sql | alter_column_comment() | No | | ||
| adapters/persist_docs.sql | alter_relation_comment() | No | | ||
| adapters/persist_docs.sql | persist_docs() | Yes | | ||
| adapters/relation.sql | drop_relation() | Yes | | ||
| adapters/relation.sql | drop_relation_if_exists() | Yes | | ||
| adapters/relation.sql | get_or_create_relation() | No | | ||
| adapters/relation.sql | load_relation() | No | | ||
| adapters/relation.sql | make_temp_relation() | Yes | | ||
| adapters/relation.sql | rename_relation() | Yes | | ||
| adapters/relation.sql | truncate_relation() | Yes | | ||
| adapters/schema.sql | create_schema() | Yes | | ||
| adapters/schema.sql | drop_schema() | Yes | | ||
|
||
## dbt Macros - materializations | ||
| dbt Macros - materializations | Function | Implemented | | ||
| -------------------------------------------------------- | -------------------------------- | ----------- | | ||
| materializations/models/incremental/merge.sql | get_merge_sql() | Yes | | ||
| materializations/models/incremental/merge.sql | get_delete_insert_merge_sql() | Yes | | ||
| materializations/models/incremental/merge.sql | get_insert_overwrite_merge_sql() | No | | ||
| materializations/models/table/create_table_as.sql | create_table_as() | Yes | | ||
| materializations/models/view/create_or_replace_view.sql | create_or_replace_view() | Yes | | ||
| materializations/models/view/create_view_as.sql | create_view_as() | Yes | | ||
| materializations/models/view/create_view_as.sql | get_create_view_as_sql() | Yes | | ||
| materializations/seeds/helpers.sql | create_csv_table() | Yes | | ||
| materializations/seeds/helpers.sql | reset_csv_table() | Yes | | ||
| materializations/seeds/helpers.sql | get_binding_char() | Yes | | ||
| materializations/seeds/helpers.sql | get_seed_column_quoted_csv() | Yes | | ||
| materializations/seeds/helpers.sql | load_csv_rows() | Yes | | ||
| materializations/snapshots/helper.sql | build_snapshot_table() | Yes | | ||
| materializations/snapshots/helper.sql | create_columns() | Yes | | ||
| materializations/snapshots/helper.sql | post_snapshot() | Yes | | ||
| materializations/snapshots/helper.sql | snapshot_staging_table() | Yes | | ||
| materializations/snapshots/snapshot_merge.sql | snapshot_merge_sql() | Yes | | ||
| materializations/snapshots/strategies.sql | snapshot_get_time() | Yes | | ||
| materializations/snapshots/strategies.sql | snapshot_hash_arguments() | Yes | | ||
| materializations/snapshots/strategies.sql | snapshot_string_as_time() | Yes | | ||
| materializations/configs.sql | set_sql_header() | Yes | | ||
| materializations/configs.sql | should_full_refresh() | Yes | | ||
| materializations/configs.sql | should_store_failures() | Yes | | ||
| materializations/hooks.sql | run_hooks() | Yes | | ||
| materializations/hooks.sql | make_hook_config() | Yes | | ||
| materializations/hooks.sql | before_begin() | Yes | | ||
| materializations/hooks.sql | in_transaction() | Yes | | ||
| materializations/hooks.sql | after_commit() | Yes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{% macro vertica__get_columns_in_relation(relation) -%} | ||
{% call statement('get_columns_in_relation', fetch_result=True) %} | ||
select | ||
column_name | ||
, data_type | ||
, character_maximum_length | ||
, numeric_precision | ||
, numeric_scale | ||
from ( | ||
select | ||
column_name | ||
, data_type | ||
, character_maximum_length | ||
, numeric_precision | ||
, numeric_scale | ||
, ordinal_position | ||
from v_catalog.columns | ||
where table_schema = '{{ relation.schema }}' | ||
and table_name = '{{ relation.identifier }}' | ||
union all | ||
select | ||
column_name | ||
, data_type | ||
, character_maximum_length | ||
, numeric_precision | ||
, numeric_scale | ||
, ordinal_position | ||
from v_catalog.view_columns | ||
where table_schema = '{{ relation.schema }}' | ||
and table_name = '{{ relation.identifier }}' | ||
) t | ||
order by ordinal_position | ||
{% endcall %} | ||
{% set table = load_result('get_columns_in_relation').table %} | ||
{{ return(sql_convert_columns_in_relation(table)) }} | ||
{% endmacro %} | ||
|
||
|
||
{% macro vertica__sql_convert_columns_in_relation(table) -%} | ||
{{ exceptions.raise_not_implemented( | ||
'sql_convert_columns_in_relation macro not implemented for adapter '+adapter.type()) }} | ||
{%- endmacro %} | ||
|
||
|
||
{% macro vertica__alter_column_type(relation, column_name, new_column_type) -%} | ||
{{ exceptions.raise_not_implemented( | ||
'alter_column_type macro not implemented for adapter '+adapter.type()) }} | ||
{%- endmacro %} | ||
|
||
|
||
{% macro vertica__alter_relation_add_remove_columns(relation, column_name, new_column_type) -%} | ||
{{ exceptions.raise_not_implemented( | ||
'alter_relation_add_remove_columns macro not implemented for adapter '+adapter.type()) }} | ||
{%- endmacro %} | ||
|
||
|
||
{# | ||
No need to implement get_columns_in_query(). Syntax supported by default. | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% macro vertica__current_timestamp() -%} | ||
current_timestamp | ||
{%- endmacro %} | ||
|
||
|
||
{% macro vertica__collect_freshness() -%} | ||
{{ exceptions.raise_not_implemented( | ||
'collect_freshness macro not implemented for adapter '+adapter.type()) }} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% macro vertica__get_create_index_sql(relation, index_dict) -%} | ||
{{ exceptions.raise_not_implemented( | ||
'get_create_index_sql macro not implemented for adapter '+adapter.type()) }} | ||
{%- endmacro %} | ||
|
||
|
||
{# | ||
No need to implement create_indexes(). Syntax supported by default. | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% macro vertica__alter_column_comment(relation, column_dict) -%} | ||
{{ exceptions.raise_not_implemented( | ||
'alter_column_comment macro not implemented for adapter '+adapter.type()) }} | ||
{%- endmacro %} | ||
|
||
|
||
{% macro vertica__alter_relation_comment(relation, relation_comment) -%} | ||
{{ exceptions.raise_not_implemented( | ||
'alter_relation_comment macro not implemented for adapter '+adapter.type()) }} | ||
{%- endmacro %} | ||
|
||
|
||
{# | ||
No need to implement persist_docs(). Syntax supported by default. | ||
#} |
Oops, something went wrong.