Interface BigQueryServices.DatasetService
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
BigQueryServicesImpl.DatasetServiceImpl,FakeDatasetService
- Enclosing interface:
BigQueryServices
An interface to get, create and delete Cloud BigQuery datasets and tables.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateDataset(String projectId, String datasetId, @Nullable String location, @Nullable String description, @Nullable Long defaultTableExpirationMs) Create aDatasetwith the givenlocation,descriptionand default expiration time for tables in the dataset (ifnull, tables don't expire).voidcreateTable(Table table) Creates the specified table if it does not exist.voiddeleteDataset(String projectId, String datasetId) Deletes the dataset specified by the datasetId value.voiddeleteTable(TableReference tableRef) Deletes the table specified by tableId from the dataset.getDataset(String projectId, String datasetId) Gets the specifiedDatasetresource by dataset ID.getTable(TableReference tableRef) Gets the specifiedTableresource by table ID.getTable(TableReference tableRef, List<String> selectedFields) getTable(TableReference tableRef, List<String> selectedFields, BigQueryServices.DatasetService.TableMetadataView view) <T> longinsertAll(TableReference ref, List<FailsafeValueInSingleWindow<TableRow, TableRow>> rowList, @Nullable List<String> insertIdList, InsertRetryPolicy retryPolicy, List<ValueInSingleWindow<T>> failedInserts, ErrorContainer<T> errorContainer, boolean skipInvalidRows, boolean ignoreUnknownValues, boolean ignoreInsertIds, List<ValueInSingleWindow<TableRow>> successfulRows) InsertsTableRowswith the specified insertIds if not null.booleanisTableEmpty(TableReference tableRef) Returns true if the table is empty.patchTableDescription(TableReference tableReference, @Nullable String tableDescription) Patch BigQueryTabledescription.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
getTable
Gets the specifiedTableresource by table ID.Returns null if the table is not found.
- Throws:
InterruptedExceptionIOException
-
getTable
@Nullable Table getTable(TableReference tableRef, List<String> selectedFields) throws InterruptedException, IOException - Throws:
InterruptedExceptionIOException
-
getTable
@Nullable Table getTable(TableReference tableRef, List<String> selectedFields, BigQueryServices.DatasetService.TableMetadataView view) throws InterruptedException, IOException - Throws:
InterruptedExceptionIOException
-
createTable
Creates the specified table if it does not exist.- Throws:
InterruptedExceptionIOException
-
deleteTable
Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.- Throws:
IOExceptionInterruptedException
-
isTableEmpty
Returns true if the table is empty.- Throws:
IOException- if the table is not found.InterruptedException
-
getDataset
Gets the specifiedDatasetresource by dataset ID.- Throws:
IOExceptionInterruptedException
-
createDataset
void createDataset(String projectId, String datasetId, @Nullable String location, @Nullable String description, @Nullable Long defaultTableExpirationMs) throws IOException, InterruptedException Create aDatasetwith the givenlocation,descriptionand default expiration time for tables in the dataset (ifnull, tables don't expire).- Throws:
IOExceptionInterruptedException
-
deleteDataset
Deletes the dataset specified by the datasetId value.Before you can delete a dataset, you must delete all its tables.
- Throws:
IOExceptionInterruptedException
-
insertAll
<T> long insertAll(TableReference ref, List<FailsafeValueInSingleWindow<TableRow, TableRow>> rowList, @Nullable List<String> insertIdList, InsertRetryPolicy retryPolicy, List<ValueInSingleWindow<T>> failedInserts, ErrorContainer<T> errorContainer, boolean skipInvalidRows, boolean ignoreUnknownValues, boolean ignoreInsertIds, List<ValueInSingleWindow<TableRow>> successfulRows) throws IOException, InterruptedExceptionInsertsTableRowswith the specified insertIds if not null.If any insert fail permanently according to the retry policy, those rows are added to failedInserts.
Returns the total bytes count of
TableRows.- Throws:
IOExceptionInterruptedException
-
patchTableDescription
Table patchTableDescription(TableReference tableReference, @Nullable String tableDescription) throws IOException, InterruptedException Patch BigQueryTabledescription.- Throws:
IOExceptionInterruptedException
-