Skip to content

Commit b1126a3

Browse files
authored
feat(bigquery): add WriteTruncateData write disposition (#12013)
Adds another named value for write disposition for WRITE_TRUNCATE_DATA, which enables schema reuse when performing truncate. internal: b/406848221
1 parent 3e177e7 commit b1126a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bigquery/table.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,14 @@ const (
288288
// Data is appended atomically on successful completion of a job.
289289
WriteAppend TableWriteDisposition = "WRITE_APPEND"
290290

291-
// WriteTruncate overrides the existing data in the destination table.
291+
// WriteTruncate overwrites the existing data in the destination table.
292292
// Data is overwritten atomically on successful completion of a job.
293293
WriteTruncate TableWriteDisposition = "WRITE_TRUNCATE"
294294

295+
// WriteTruncateData overwrites the data, but keeps the constraints and
296+
// reuses the schema for an existing table.
297+
WriteTruncateData TableWriteDisposition = "WRITE_TRUNCATE_DATA"
298+
295299
// WriteEmpty fails writes if the destination table already contains data.
296300
WriteEmpty TableWriteDisposition = "WRITE_EMPTY"
297301
)

0 commit comments

Comments
 (0)