When using the getTable method of the BigQuery client the project of the TableId is overwritten. TableId would previously ignore this if a project had been set. Table Id has been changed such that the project is always overwritten. There is now no way to get a table for a project other than the one the client was created for.
TableId tableId = TableId.of(project, schema, tableName);
Table table = client.getTable(tableId);
// table returns null if project != client.getOptions().getProjectId()
this is due to the change in TableId
In BigQueryImpl:
public Table getTable(TableId tableId, TableOption... options) {
final TableId completeTableId = tableId.setProjectId(getOptions().getProjectId());
...
TableId old code:
TableId setProjectId(String projectId) {
return getProject() != null ? this : TableId.of(projectId, getDataset(), getTable());
}
TableId new code:
TableId setProjectId(String projectId) {
Preconditions
.checkArgument(!Strings.isNullOrEmpty(projectId), "Provided projectId is null or empty");
return TableId.of(projectId, getDataset(), getTable());
}
When using the getTable method of the BigQuery client the project of the TableId is overwritten. TableId would previously ignore this if a project had been set. Table Id has been changed such that the project is always overwritten. There is now no way to get a table for a project other than the one the client was created for.
this is due to the change in TableId
In BigQueryImpl:
TableId old code:
TableId new code: