-
Notifications
You must be signed in to change notification settings - Fork 168
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
BigQuery: Support WRITE_TRUNCATE as writeDisposition mode #1359
Comments
Hi, @dali-rmw! Can you clarify in which scenarios you'd like to use this setting? If I understand correctly from the docs passing config { type: "table" }
SELECT 1 AS TEST In this case the output table for such action will be rewritten on every run so it is basically an equivalent thing. More details here. If it's not that you want feel free to describe your scenario :) |
hi @dali-rmw! i use dataform in BigQuery/GCP too. As @kolina said, when you define the config snippet as If you want to append data to an existing table, you have to use the Best regards. |
I have a scenario where WRITE_TRUNCATE and config{type:"table"} are not exactly the same thing. I have a BQ materialized view which uses a particular table table_A as one of its sources. Now, when I try that with Dataform config{type: "table"} it actually does a REPLACE of Table_A. The problem is that materialized views do not like to have their source tables changed. If you try to select from that materialized view you get While I could drop and create the materialized view, this particular one is expensive to run as a one off - we end up not really getting the benefits of the materialized view. |
@joajen This is an interesting use case I'm curious would the expected output be that dataform create the materialized view and pass along options similar to these to BigQuery api https://cloud.google.com/bigquery/docs/materialized-views-manage#refresh or are you talking about that |
@andres-lowrie BQ has limitations on the materialized views - if you delete and recreate a base table the materialized view refresh will fail. See the last point at https://cloud.google.com/bigquery/docs/materialized-views-intro#limitations |
Hello, As mentioned by @joajen, the behavior of a table type involves the deletion and recreation of the table. The issue I'm facing is that I create my tables using Terraform. When I specify the type as "table" in Dataform, it results in Dataform deleting and recreating the table. Consequently, my Terraform state registers this as a deleted table and attempts to recreate it each time I run Terraform. |
This is a very reasonable request, but it's complex in its implementation, because we can either:
However these options would be best defined at the config per-table level, but:
I'll keep thinking about what the best solution for this would be. |
Note: this implementation for this is similar to the request in #1385, as it interacts with the API in the same way. |
No description provided.
The text was updated successfully, but these errors were encountered: