-
Notifications
You must be signed in to change notification settings - Fork 167
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
Add incremental materializations #226
Add incremental materializations #226
Conversation
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.
@stu-k Thanks for pushing up the initial PR!
As discussed during our chat yesterday, there are (I believe) two cases in which we do not create a "temp" table before merging:
merge
strategy withon_schema_change: ignore
insert_overwrite
strategy with "static"partitions
config
In those cases, dbt templates the model {{ sql }}
directly into the merge
statement. That won't work for Python, so we really do need to submit the Python job and save the results to a table before the merge
takes place. We also need to make sure that table is cleaned up after the merge
, either by altering it to set it to expire within X hours (our standard approach is 12), or drop it explicitly at the end of the materialization.
@jtcohen6 Apologies I didn't mean to add you as a reviewer, this is still in progress, I'm just using the pr to run the CI. |
@stu-k Oh whoops, sorry! Keep on keepin' on! |
4a070ff
to
b2763d9
Compare
b2763d9
to
1f4799c
Compare
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.
Looks great to me!
{%- call statement('main') -%} | ||
{{ build_sql }} | ||
{% endcall %} | ||
Also, why does not either drop_relation or adapter.drop_relation work here?! |
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.
Should we remove this comment?
Description
Implements the incremental materialization for bigquery. Nearly directly copied from Ian's work in spark