Skip to content

Commit

Permalink
TestSparkUnitTestCaseInsensitivity, TestSparkUnitTestInvalidInput
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Feb 7, 2024
1 parent e62b73d commit 88d2a47
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dbt/include/spark/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@

{#-- We can't use temporary tables with `create ... as ()` syntax --#}
{% macro spark__create_temporary_view(relation, compiled_code) -%}
create or replace temporary view {{ relation }} as
create or replace temporary view {{ relation.identifier }} as
{{ compiled_code }}
{%- endmacro -%}

Expand Down Expand Up @@ -387,6 +387,10 @@
"identifier": tmp_identifier
}) -%}

{#-- for SQL model we will create temp view that doesn't have database and schema --#}
{%- if language == 'sql'-%}
{%- set tmp_relation = tmp_relation.include(database=false, schema=false) -%}
{%- endif -%}
{% do return(tmp_relation) %}
{% endmacro %}

Expand Down
10 changes: 10 additions & 0 deletions tests/functional/adapter/unit_testing/test_unit_testing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from dbt.tests.adapter.unit_testing.test_case_insensitivity import BaseUnitTestCaseInsensivity
from dbt.tests.adapter.unit_testing.test_invalid_input import BaseUnitTestInvalidInput


class TestSparkUnitTestCaseInsensitivity(BaseUnitTestCaseInsensivity):
pass


class TestSparkUnitTestInvalidInput(BaseUnitTestInvalidInput):
pass

0 comments on commit 88d2a47

Please sign in to comment.