deleteTable method
Removes a table definition from the Data Catalog.
To ensure the immediate deletion of all related resources, before calling
DeleteTable
, use DeleteTableVersion
or
BatchDeleteTableVersion
, and DeletePartition
or
BatchDeletePartition
, to delete any resources that belong to
the table.
May throw EntityNotFoundException. May throw InvalidInputException. May throw InternalServiceException. May throw OperationTimeoutException.
Parameter databaseName
:
The name of the catalog database in which the table resides. For Hive
compatibility, this name is entirely lowercase.
Parameter name
:
The name of the table to be deleted. For Hive compatibility, this name is
entirely lowercase.
Parameter catalogId
:
The ID of the Data Catalog where the table resides. If none is provided,
the AWS account ID is used by default.
Implementation
Future<void> deleteTable({
required String databaseName,
required String name,
String? catalogId,
}) async {
ArgumentError.checkNotNull(databaseName, 'databaseName');
_s.validateStringLength(
'databaseName',
databaseName,
1,
255,
isRequired: true,
);
ArgumentError.checkNotNull(name, 'name');
_s.validateStringLength(
'name',
name,
1,
255,
isRequired: true,
);
_s.validateStringLength(
'catalogId',
catalogId,
1,
255,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.DeleteTable'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DatabaseName': databaseName,
'Name': name,
if (catalogId != null) 'CatalogId': catalogId,
},
);
}