-
Couldn't load subscription status.
- Fork 147
feat: add support for distributed incremental microbatches #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,11 +4,10 @@ | |||||
| _input_model_sql = """ | ||||||
| {{ | ||||||
| config( | ||||||
| materialized='table', | ||||||
| materialized='%s', | ||||||
| event_time='event_time' | ||||||
| ) | ||||||
| }} | ||||||
|
|
||||||
| select 1 as id, toDateTime('2020-01-01 00:00:00') as event_time | ||||||
| union all | ||||||
| select 2 as id, toDateTime('2020-01-02 00:00:00') as event_time | ||||||
|
|
@@ -20,14 +19,14 @@ | |||||
| {{ | ||||||
| config( | ||||||
| materialized='incremental', | ||||||
| is_distributed=%s, | ||||||
| incremental_strategy='microbatch', | ||||||
| unique_key='id', | ||||||
| event_time='event_time', | ||||||
| batch_size='day', | ||||||
| begin=modules.datetime.datetime(2020, 1, 1, 0, 0, 0) | ||||||
| ) | ||||||
| }} | ||||||
|
|
||||||
| select * from {{ ref('input_model') }} | ||||||
| """ | ||||||
|
|
||||||
|
|
@@ -36,8 +35,24 @@ class TestMicrobatchIncremental(BaseMicrobatch): | |||||
| @pytest.fixture(scope="class") | ||||||
| def models(self): | ||||||
| return { | ||||||
| "input_model.sql": _input_model_sql, | ||||||
| "microbatch_model.sql": _microbatch_model_sql, | ||||||
| "input_model.sql": _input_model_sql % "table", | ||||||
| "microbatch_model.sql": _microbatch_model_sql % "False", # `is_distributed` param | ||||||
|
||||||
| "microbatch_model.sql": _microbatch_model_sql % "False", # `is_distributed` param | |
| "microbatch_model.sql": _microbatch_model_sql % False, # `is_distributed` param |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value for is_distributed may be passed as a string instead of a boolean, which could lead to unintended behavior in get_on_cluster. Consider adding an explicit conversion to boolean.