/** * Deletes this dataset. * * @return {@code true} if dataset was deleted, {@code false} if it was not found * @throws BigQueryException upon failure */ public boolean delete() { return bigquery.delete(datasetId()); }
/** * Returns the paginated list of tables in this dataset. * * @param options options for listing tables * @throws BigQueryException upon failure */ public Page<Table> list(BigQuery.TableListOption... options) { return bigquery.listTables(datasetId(), options); }
/** * Checks if this dataset exists. * * @return {@code true} if this dataset exists, {@code false} otherwise * @throws BigQueryException upon failure */ public boolean exists() { return bigquery.getDataset(datasetId(), BigQuery.DatasetOption.fields()) != null; }
/** * Fetches current dataset's latest information. Returns {@code null} if the dataset does not * exist. * * @param options dataset options * @return a {@code Dataset} object with latest information or {@code null} if not found * @throws BigQueryException upon failure */ public Dataset reload(BigQuery.DatasetOption... options) { return bigquery.getDataset(datasetId().dataset(), options); }
/** * Returns the requested table in this dataset or {@code null} if not found. * * @param table user-defined id of the requested table * @param options table options * @throws BigQueryException upon failure */ public Table get(String table, BigQuery.TableOption... options) { return bigquery.getTable(TableId.of(datasetId().dataset(), table), options); }
/** * Creates a new table in this dataset. * * @param table the table's user-defined id * @param definition the table's definition * @param options options for table creation * @return a {@code Table} object for the created table * @throws BigQueryException upon failure */ public Table create(String table, TableDefinition definition, BigQuery.TableOption... options) { TableInfo tableInfo = TableInfo.of(TableId.of(datasetId().dataset(), table), definition); return bigquery.create(tableInfo, options); }