Skip to content

Commit

Permalink
highlighted the changed lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed May 31, 2024
1 parent 3be5716 commit 807ac26
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ Implement at the `dbt-snowflake` level in `snowflake__get_rename_x_sql()`:
new_name: str - new identifier for `relation`
Returns: templated string
*/
------------ CHANGE: updated the line below ------------
alter view {{ relation }} rename to {{ relation.incorporate(path={"identifier": new_name}) }}
{%- endmacro -%}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Implement at the `dbt-adapters` level in `get_rename_sql()`:
Returns: templated string
*/
{{- log('Applying RENAME to: ' ~ relation) -}}
------------ CHANGE: added the line below ------------
{% set new_name = relation.incorporate(path={"identifier": new_name}).render() if new_name is string else new_name.render() %}
{{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}
{%- endmacro -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Implement at the `dbt-snowflake` level by overriding `default__get_rename_sql()`


------------------------------------------ dbt-snowflake ------------------------------------------
------------ CHANGE: added the entire macro below ------------
{%- macro snowflake__get_rename_sql(relation, new_name) -%}
{% set new_name = relation.incorporate(path={"identifier": new_name}).render() if new_name is string else new_name.render() %}
{{ default__get_rename_sql(relation, new_name) }}
Expand Down

0 comments on commit 807ac26

Please sign in to comment.