mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02: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:
parent
6f00059a80
commit
6fd3592a54
1 changed files with 4 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue