batchGetPartition method

Future<BatchGetPartitionResponse> batchGetPartition({
  1. required String databaseName,
  2. required List<PartitionValueList> partitionsToGet,
  3. required String tableName,
  4. String? catalogId,
})

Retrieves partitions in a batch request.

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

Parameter databaseName : The name of the catalog database where the partitions reside.

Parameter partitionsToGet : A list of partition values identifying the partitions to retrieve.

Parameter tableName : The name of the partitions' table.

Parameter catalogId : The ID of the Data Catalog where the partitions in question reside. If none is supplied, the AWS account ID is used by default.

Implementation

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

  return BatchGetPartitionResponse.fromJson(jsonResponse.body);
}