-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c6fcb4
commit 101aad2
Showing
6 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: Add Microbatch Strategy to dbt-spark | ||
time: 2024-09-25T12:52:42.872017+01:00 | ||
custom: | ||
Author: michelleark | ||
Issue: "1109" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tests/functional/adapter/incremental_strategies/test_microbatch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
|
||
from dbt.tests.adapter.incremental.test_incremental_microbatch import ( | ||
BaseMicrobatch, | ||
) | ||
|
||
# No requirement for a unique_id for spark microbatch! | ||
_microbatch_model_no_unique_id_sql = """ | ||
{{ config(materialized='incremental', incremental_strategy='microbatch', event_time='event_time', batch_size='day', begin=modules.datetime.datetime(2020, 1, 1, 0, 0, 0), partition_by=['date_day'], file_format='parquet') }} | ||
select *, cast(event_time as date) as date_day | ||
from {{ ref('input_model') }} | ||
""" | ||
|
||
|
||
@pytest.mark.skip_profile( | ||
"databricks_http_cluster", "databricks_sql_endpoint", "spark_session", "spark_http_odbc" | ||
) | ||
class TestMicrobatch(BaseMicrobatch): | ||
@pytest.fixture(scope="class") | ||
def microbatch_model_sql(self) -> str: | ||
return _microbatch_model_no_unique_id_sql |