mirror of
https://github.com/google/nomulus
synced 2026-01-09 15:43:52 +00:00
Change BigQuery call from update to patch
For invoicing, we have been using the BigQuery update() call, but it turns out that that's not what we want to do. That replaces all values, clearing out any that you don't specify. What we want is patch(), which updates only the values you specify. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=146673068
This commit is contained in:
@@ -376,8 +376,11 @@ public class BigqueryConnection implements AutoCloseable {
|
||||
TableReference ref = table.getTableReference();
|
||||
try {
|
||||
if (checkTableExists(ref.getDatasetId(), ref.getTableId())) {
|
||||
// Make sure to use patch() rather than update(). The former changes only those properties
|
||||
// which are specified, while the latter would change everything, blanking out unspecified
|
||||
// properties.
|
||||
bigquery.tables()
|
||||
.update(ref.getProjectId(), ref.getDatasetId(), ref.getTableId(), table)
|
||||
.patch(ref.getProjectId(), ref.getDatasetId(), ref.getTableId(), table)
|
||||
.execute();
|
||||
} else {
|
||||
bigquery.tables()
|
||||
|
||||
Reference in New Issue
Block a user