Skip to content

Commit

Permalink
Update create_table_as.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
prdpsvs authored May 24, 2024
1 parent 223a8e6 commit 1f439e2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
type='view')-%}
{%- set temp_view_sql = sql.replace("'", "''") -%}

{{ synapse__drop_relation_script(tmp_relation) }}

{{ synapse__drop_relation_script(relation) }}
{% do adapter.drop_relation(tmp_relation) %}
{% do adapter.drop_relation(relation) %}

{{ synapse__create_view_as(tmp_relation, sql) }}

Expand Down Expand Up @@ -39,6 +38,6 @@
EXEC('CREATE TABLE [{{relation.database}}].[{{relation.schema}}].[{{relation.identifier}}]WITH(DISTRIBUTION = {{dist}},{{index}}) AS (SELECT * FROM [{{tmp_relation.database}}].[{{tmp_relation.schema}}].[{{tmp_relation.identifier}}]);');
{% endif %}

{{ synapse__drop_relation_script(tmp_relation) }}
{% do adapter.drop_relation(tmp_relation) %}

{% endmacro %}

0 comments on commit 1f439e2

Please sign in to comment.