use of com.google.api.services.bigquery.model.TableList.Tables in project beam by apache.
the class BigqueryClient method deleteDataset.
public void deleteDataset(String projectId, String datasetId) {
try {
TableList tables = bqClient.tables().list(projectId, datasetId).execute();
for (Tables table : tables.getTables()) {
this.deleteTable(projectId, datasetId, table.getTableReference().getTableId());
}
} catch (Exception e) {
LOG.debug("Exceptions caught when listing all tables: " + e.getMessage());
}
try {
bqClient.datasets().delete(projectId, datasetId).execute();
LOG.info("Successfully deleted dataset: " + datasetId);
} catch (Exception e) {
LOG.debug("Exceptions caught when deleting dataset: " + e.getMessage());
}
}
Aggregations