From 53caea99bb4d01d02315bf97a309ee0487b64557 Mon Sep 17 00:00:00 2001 From: Seth Hollyman Date: Fri, 18 Apr 2025 20:18:39 +0000 Subject: [PATCH 1/2] feat: add WRITE_TRUNCATE_DATA as an enum value for write disposition For existing tables, WRITE_TRUNCATE_DATA preserves schema/constraints and replaces data. internal issue: b/406848221 --- .../src/main/java/com/google/cloud/bigquery/JobInfo.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java index 8f571ff55..ca9315e88 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java @@ -66,6 +66,9 @@ public enum WriteDisposition { /** Configures the job to overwrite the table data if table already exists. */ WRITE_TRUNCATE, + /** Configures the job to retain schema and constraints on an existing table, and truncate and replace data. */ + WRITE_TRUNCATE_DATA, + /** Configures the job to append data to the table if it already exists. */ WRITE_APPEND, From 2929dc6d08dea24bc6affe68bf838e392f3d0ae8 Mon Sep 17 00:00:00 2001 From: Seth Hollyman Date: Fri, 18 Apr 2025 20:28:11 +0000 Subject: [PATCH 2/2] formatting --- .../src/main/java/com/google/cloud/bigquery/JobInfo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java index ca9315e88..fdf1b6e60 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/JobInfo.java @@ -66,7 +66,10 @@ public enum WriteDisposition { /** Configures the job to overwrite the table data if table already exists. */ WRITE_TRUNCATE, - /** Configures the job to retain schema and constraints on an existing table, and truncate and replace data. */ + /** + * Configures the job to retain schema and constraints on an existing table, and truncate and + * replace data. + */ WRITE_TRUNCATE_DATA, /** Configures the job to append data to the table if it already exists. */