Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshot structure changes #194

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions dbt/include/teradata/macros/materializations/snapshot/helpers.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
{% macro teradata__create_columns(relation, columns) %}
{% for column in columns %}
{% call statement() %}
alter table {{ relation.render() }} add "{{ column.name }}" {{ column.data_type }};
{% endcall %}
{% endfor %}
{% endmacro %}

{% macro teradata__post_snapshot(staging_relation) %}
{{ adapter.dispatch('drop_relation', 'dbt')(staging_relation) }}
{% endmacro %}

{% macro teradata__get_true_sql() %}
{{ return('1 = 1') }}
{% endmacro %}

{% macro teradata__snapshot_staging_table(strategy, source_sql, target_relation) -%}

with snapshot_query as (
Expand Down Expand Up @@ -125,8 +141,3 @@
) sbq

{% endmacro %}

{% macro teradata__post_snapshot(staging_relation) %}
{{ adapter.dispatch('drop_relation', 'dbt')(staging_relation) }}
{% endmacro %}

Loading