batchDeletePartition method

Future<BatchDeletePartitionResponse> batchDeletePartition({
  1. required String databaseName,
  2. required List<PartitionValueList> partitionsToDelete,
  3. required String tableName,
  4. String? catalogId,
})

Deletes one or more partitions in a batch operation.

May throw InvalidInputException. May throw EntityNotFoundException. May throw InternalServiceException. May throw OperationTimeoutException.

Parameter databaseName : The name of the catalog database in which the table in question resides.

Parameter partitionsToDelete : A list of PartitionInput structures that define the partitions to be deleted.

Parameter tableName : The name of the table that contains the partitions to be deleted.

Parameter catalogId : The ID of the Data Catalog where the partition to be deleted resides. If none is provided, the AWS account ID is used by default.

Implementation

Future<BatchDeletePartitionResponse> batchDeletePartition({
  required String databaseName,
  required List<PartitionValueList> partitionsToDelete,
  required String tableName,
  String? catalogId,
}) async {
  ArgumentError.checkNotNull(databaseName, 'databaseName');
  _s.validateStringLength(
    'databaseName',
    databaseName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(partitionsToDelete, 'partitionsToDelete');
  ArgumentError.checkNotNull(tableName, 'tableName');
  _s.validateStringLength(
    'tableName',
    tableName,
    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.BatchDeletePartition'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DatabaseName': databaseName,
      'PartitionsToDelete': partitionsToDelete,
      'TableName': tableName,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );

  return BatchDeletePartitionResponse.fromJson(jsonResponse.body);
}