service.datasets().get(tableRef.getProjectId(), tableRef.getDatasetId()).execute();
/** * Returns the dataset specified by datasetID. * * Create a request for the method "datasets.get". * * This request holds the parameters needed by the bigquery server. After setting any optional * parameters, call the {@link Get#execute()} method to invoke the remote operation. * * @param projectId Project ID of the requested dataset * @param datasetId Dataset ID of the requested dataset * @return the request */ public Get get(java.lang.String projectId, java.lang.String datasetId) throws java.io.IOException { Get result = new Get(projectId, datasetId); initialize(result); return result; }
@Override public Dataset getDataset(String projectId, String datasetId, Map<Option, ?> options) { try { return bigquery .datasets() .get(projectId, datasetId) .setFields(Option.FIELDS.getString(options)) .execute(); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { return null; } throw serviceException; } }
@Override public Dataset getDataset(String datasetId, Map<Option, ?> options) { try { return bigquery.datasets() .get(this.options.projectId(), datasetId) .setFields(FIELDS.getString(options)) .execute(); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.code() == HTTP_NOT_FOUND) { return null; } throw serviceException; } }
@Override public Dataset getDataset(String datasetId, Map<Option, ?> options) { try { return bigquery.datasets() .get(this.options.projectId(), datasetId) .setFields(FIELDS.getString(options)) .execute(); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.code() == HTTP_NOT_FOUND) { return null; } throw serviceException; } }
boolean datasetExists(String projectId, String datasetId) throws IOException { try { client.datasets().get(projectId, datasetId).execute(); return true; } catch (GoogleJsonResponseException e) { if (e.getStatusCode() == HttpStatusCodes.STATUS_CODE_NOT_FOUND) { return false; } throw e; } }
@Override public Dataset getDataset(String projectId, String datasetId, Map<Option, ?> options) { try { return bigquery .datasets() .get(projectId, datasetId) .setFields(Option.FIELDS.getString(options)) .execute(); } catch (IOException ex) { BigQueryException serviceException = translate(ex); if (serviceException.getCode() == HTTP_NOT_FOUND) { return null; } throw serviceException; } }