Skip to content

Commit

Permalink
more minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-db committed Mar 4, 2025
1 parent 20f134d commit a7690a3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dbt/include/databricks/macros/adapters/columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

{% macro databricks__get_columns_in_query(select_sql) %}
{{ log("Getting column information via empty query")}}
{% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}
{% call statement('get_columns_in_query', fetch_result=True) -%}
{{ get_empty_subquery_sql(select_sql) }}
{% endcall %}
{{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}
Expand Down
11 changes: 5 additions & 6 deletions dbt/include/databricks/macros/relations/create_backup.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{%- macro create_backup(relation) -%}
-- get the standard backup name
{% set backup_relation = make_backup_relation(relation, relation.type) %}
-- get the standard backup name
{% set backup_relation = make_backup_relation(relation, relation.type) %}

-- drop any pre-existing backup
{{ drop_relation(backup_relation) }}

{{ adapter.rename_relation(relation, backup_relation) }}
-- drop any pre-existing backup
{{ drop_relation(backup_relation) }}

{{ adapter.rename_relation(relation, backup_relation) }}
{%- endmacro -%}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{%- macro databricks__get_create_intermediate_sql(relation, sql) -%}

-- get the standard intermediate name
{% set intermediate_relation = make_intermediate_relation(relation) %}

-- drop any pre-existing intermediate
Expand Down
2 changes: 1 addition & 1 deletion dbt/include/databricks/macros/relations/view/drop.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% macro databricks__drop_view(relation) -%}
drop view if exists {{ relation.render() }}
DROP VIEW IF EXISTS {{ relation.render() }}
{%- endmacro %}
2 changes: 1 addition & 1 deletion dbt/include/databricks/macros/relations/view/rename.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% macro databricks__get_rename_view_sql(relation, new_name) %}
ALTER VIEW {{ relation.render() }} RENAME TO {{ new_name }}
ALTER VIEW {{ relation.render() }} RENAME TO `{{ new_name }}`
{% endmacro %}

0 comments on commit a7690a3

Please sign in to comment.