Согласно terraform docs , есть опция write_disposition
. Возможные значения - WRITE_TRUNCATE
, WRITE_APPEND
, WRITE_EMPTY
resource "google_bigquery_table" "foo" {
dataset_id = google_bigquery_dataset.bar.dataset_id
table_id = "job_load_table"
}
resource "google_bigquery_dataset" "bar" {
dataset_id = "job_load_dataset"
friendly_name = "test"
description = "This is a test description"
location = "US"
}
resource "google_bigquery_job" "job" {
job_id = "job_load"
labels = {
"my_job" ="load"
}
load {
source_uris = [
"gs://cloud-samples-data/bigquery/us-states/us-states-by-date.csv",
]
destination_table {
project_id = google_bigquery_table.foo.project
dataset_id = google_bigquery_table.foo.dataset_id
table_id = google_bigquery_table.foo.table_id
}
skip_leading_rows = 1
schema_update_options = ["ALLOW_FIELD_RELAXATION", "ALLOW_FIELD_ADDITION"]
write_disposition = "WRITE_APPEND"
autodetect = true
}
}