batchDeleteTable method
Deletes multiple tables at once.
To ensure the immediate deletion of all related resources, before calling
BatchDeleteTable, use DeleteTableVersion or
BatchDeleteTableVersion, and DeletePartition or
BatchDeletePartition, to delete any resources that belong to
the table.
May throw EntityNotFoundException.
May throw GlueEncryptionException.
May throw InternalServiceException.
May throw InvalidInputException.
May throw OperationTimeoutException.
May throw ResourceNotReadyException.
Parameter databaseName :
The name of the catalog database in which the tables to delete reside. For
Hive compatibility, this name is entirely lowercase.
Parameter tablesToDelete :
A list of the table to delete.
Parameter catalogId :
The ID of the Data Catalog where the table resides. If none is provided,
the Amazon Web Services account ID is used by default.
Parameter transactionId :
The transaction ID at which to delete the table contents.
Implementation
Future<BatchDeleteTableResponse> batchDeleteTable({
required String databaseName,
required List<String> tablesToDelete,
String? catalogId,
String? transactionId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.BatchDeleteTable'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DatabaseName': databaseName,
'TablesToDelete': tablesToDelete,
if (catalogId != null) 'CatalogId': catalogId,
if (transactionId != null) 'TransactionId': transactionId,
},
);
return BatchDeleteTableResponse.fromJson(jsonResponse.body);
}