Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
set spark.sql.sources.partitionOverwriteMode = {{ value }}
{%- endcall -%}
{% else %}
{{ exceptions.raise_compiler_error('INSERT OVERWRITE is only properly supported on all-purpose clusters. On SQL Warehouses, this strategy would be equivalent to using the table materialization.') }}
{{ exceptions.warn("INSERT OVERWRITE is only properly supported on all-purpose clusters. On SQL Warehouses, this strategy would be equivalent to using the table materialization.") }}
{% endif %}
{% endmacro %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,37 @@ def test_incremental(self, project):
util.check_relations_equal(project.adapter, ["overwrite_model", "upsert_expected"])


# Insert overwrite in SQL warehouse is expected to behave like a table materialization
# We support this as a short term hack for customers who want the side effect of reusing
# the same table on subsequent runs
@pytest.mark.skip_profile("databricks_uc_cluster", "databricks_cluster")
class TestInsertOverwriteSqlWarehouse(IncrementalBase):
@pytest.fixture(scope="class")
def project_config_update(self):
return {
"models": {
"+incremental_strategy": "insert_overwrite",
"+partition_by": "id",
},
}

@pytest.fixture(scope="class")
def seeds(self):
return {
"overwrite_expected.csv": fixtures.overwrite_expected,
}

@pytest.fixture(scope="class")
def models(self):
return {
"overwrite_model.sql": fixtures.base_model,
}

def test_incremental(self, project):
self.seed_and_run_twice()
util.check_relations_equal(project.adapter, ["overwrite_model", "overwrite_expected"])


@pytest.mark.external
@pytest.mark.skip("This test is not repeatable due to external location")
class TestInsertOverwriteParquet(InsertOverwriteBase):
Expand Down
Loading