}
log.warning(sb.toString());
}
public static Table createTable(String projectId, String datasetId, String tableId, TableSchema schema, Bigquery bigquery) throws IOException {
Table table = new Table();
TableReference tableRef = new TableReference();
tableRef.setDatasetId(datasetId);
tableRef.setProjectId(projectId);
tableRef.setTableId(tableId);
table.setTableReference(tableRef);
table.setFriendlyName(tableId);
table.setSchema(schema);
try {
return bigquery.tables().insert(projectId, datasetId, table).execute();
}
catch (GoogleJsonResponseException e) {