diff --git a/.changes/unreleased/Features-20231011-094718.yaml b/.changes/unreleased/Features-20231011-094718.yaml new file mode 100644 index 000000000..8503a70b8 --- /dev/null +++ b/.changes/unreleased/Features-20231011-094718.yaml @@ -0,0 +1,6 @@ +kind: Features +body: Create temporary views with 'or replace' +time: 2023-10-11T09:47:18.485764-07:00 +custom: + Author: annazizian + Issue: "350" diff --git a/dbt/include/spark/macros/adapters.sql b/dbt/include/spark/macros/adapters.sql index 9e277dd68..bfc1f198d 100644 --- a/dbt/include/spark/macros/adapters.sql +++ b/dbt/include/spark/macros/adapters.sql @@ -138,7 +138,7 @@ {#-- We can't use temporary tables with `create ... as ()` syntax --#} {% macro spark__create_temporary_view(relation, compiled_code) -%} - create temporary view {{ relation }} as + create or replace temporary view {{ relation }} as {{ compiled_code }} {%- endmacro -%}