getPartition method

Future<GetPartitionResponse> getPartition({
  1. required String databaseName,
  2. required List<String> partitionValues,
  3. required String tableName,
  4. AuditContext? auditContext,
  5. String? catalogId,
})

Retrieves information about a specified partition.

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

Parameter databaseName : The name of the catalog database where the partition resides.

Parameter partitionValues : The values that define the partition.

Parameter tableName : The name of the partition's table.

Parameter catalogId : The ID of the Data Catalog where the partition in question resides. If none is provided, the Amazon Web Services account ID is used by default.

Implementation

Future<GetPartitionResponse> getPartition({
  required String databaseName,
  required List<String> partitionValues,
  required String tableName,
  AuditContext? auditContext,
  String? catalogId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetPartition'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DatabaseName': databaseName,
      'PartitionValues': partitionValues,
      'TableName': tableName,
      if (auditContext != null) 'AuditContext': auditContext,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );

  return GetPartitionResponse.fromJson(jsonResponse.body);
}