bigquery.tables().delete(exporterConfig.getBigqueryProjectId(), exporterConfig.getBigqueryDatasetId(), kind).execute();
/** * Deletes the table specified by tableId from the dataset. If the table contains data, all the data * will be deleted. * * Create a request for the method "tables.delete". * * This request holds the parameters needed by the bigquery server. After setting any optional * parameters, call the {@link Delete#execute()} method to invoke the remote operation. * * @param projectId Project ID of the table to delete * @param datasetId Dataset ID of the table to delete * @param tableId Table ID of the table to delete * @return the request */ public Delete delete(java.lang.String projectId, java.lang.String datasetId, java.lang.String tableId) throws java.io.IOException { Delete result = new Delete(projectId, datasetId, tableId); initialize(result); return result; }
void deleteTable(String projectId, String datasetId, String tableId) throws IOException { try { client.tables().delete(projectId, datasetId, tableId).execute(); } catch (GoogleJsonResponseException e) { if (e.getStatusCode() == HttpStatusCodes.STATUS_CODE_NOT_FOUND) { // Already deleted return; } throw e; } }
@Override public boolean deleteTable(String datasetId, String tableId) { try { bigquery.tables().delete(this.options.projectId(), datasetId, tableId).execute(); return true; } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.code() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }
@Override public boolean deleteTable(String datasetId, String tableId) { try { bigquery.tables().delete(this.options.projectId(), datasetId, tableId).execute(); return true; } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.code() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }
@Override public void cleanupExport() throws IOException { if (deleteIntermediateTable) { logger.atInfo().log( "Deleting input intermediate table: %s:%s.%s", tableToExport.getProjectId(), tableToExport.getDatasetId(), tableToExport.getTableId()); Bigquery.Tables tables = bigQueryHelper.getRawBigquery().tables(); Bigquery.Tables.Delete delete = tables.delete( tableToExport.getProjectId(), tableToExport.getDatasetId(), tableToExport.getTableId()); delete.execute(); } delegate.cleanupExport(); }
@Override public boolean deleteTable(String projectId, String datasetId, String tableId) { try { bigquery.tables().delete(projectId, datasetId, tableId).execute(); return true; } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }
public void deleteTable(String projectId, String datasetId, String tableName) { try { bqClient.tables().delete(projectId, datasetId, tableName).execute(); LOG.info("Successfully deleted table: " + tableName); } catch (Exception e) { LOG.debug("Exception caught when deleting table: " + e.getMessage()); } }
@Override public boolean deleteTable(String projectId, String datasetId, String tableId) { try { bigquery.tables().delete(projectId, datasetId, tableId).execute(); return true; } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { return false; } throw serviceException; } }