-
Notifications
You must be signed in to change notification settings - Fork 234
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
replace partitionOverwriteMode inside merge strategy #117
replace partitionOverwriteMode inside merge strategy #117
Conversation
Hey @charlottevdscheun, long time! :) I think the issue here is that your model does not have a To my knowledge, running |
Hee @jtcohen6, yeah I thought hey lets follow in Fokko's footsteps and contribute too ;) I'll explain my usecase: We have a problem in our project, if our pipeline runs, it drops and recreates the end table. Leading to a 15 minute unavailable table for our model. Thats why we started using the delta file so that we could overwrite the table and it would still be available to our model. I saw that that function was already available in the incremental materialization, but for it to work without a partition or unique key it doesnt want the I think this overwrite strategy maybe could be a strategy function outside the incremental materialization, what do you think? |
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.
Tnx @charlottevdscheun for fixing this!
Fokko's suggestion to remove unique key from the if statement Co-authored-by: Fokko Driesprong <fokko@driesprong.frl>
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.
Ok, this makes sense! I agree with keeping this approach as part of the I think we'll want to explain this as: "If a @charlottevdscheun Could I trouble you to add that piece to the "Incremental Models" section of the README as part of this PR? I can take care of updating the primary docs before the next dbt-spark release. |
@jtcohen6 No trouble at all! Thank you for looking at my first PR ;) |
Problem:
Using incremental materialization with a insert_overwrite strategy without a unique_key doesn't work.
Error message
Table charlotte.test does not support dynamic overwrite in batch mode.
Fix
Relocating the "spark.sql.sources.partitionOverwriteMode = DYNAMIC" inside the merge strategy. Because this is only necessary when you give a unique_key, and for insert_overwrite this is not a must, but for merge it is.