Fix latest_snapshot "pointer" query to use to fully-qualified table reference

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125105776
This commit is contained in:
nickfelt 2016-06-16 14:53:24 -07:00 committed by Ben McIlwain
parent b6da74d424
commit 038d3d5031
2 changed files with 11 additions and 13 deletions

View file

@ -89,17 +89,16 @@ public class UpdateSnapshotViewAction implements Runnable {
.setDatasetId(LATEST_SNAPSHOT_DATASET)
.setTableId(kindName))
.setView(new ViewDefinition().setQuery(
SqlTemplate.create("SELECT * FROM [%DATASET%.%TABLE%]")
SqlTemplate.create("SELECT * FROM [%PROJECT%:%DATASET%.%TABLE%]")
.put("PROJECT", projectId)
.put("DATASET", datasetId)
.put("TABLE", tableId)
.build())));
logger.infofmt(
"Updated view %s:%s to point at snapshot table %s:%s.",
LATEST_SNAPSHOT_DATASET,
kindName,
datasetId,
tableId);
"Updated view %s to point at snapshot table %s.",
String.format("[%s:%s.%s]", projectId, LATEST_SNAPSHOT_DATASET, kindName),
String.format("[%s:%s.%s]", projectId, datasetId, tableId));
}
private static void updateTable(Bigquery bigquery, Table table) throws IOException {