getUnfilteredPartitionsMetadata method

Future<GetUnfilteredPartitionsMetadataResponse> getUnfilteredPartitionsMetadata({
  1. required String catalogId,
  2. required String databaseName,
  3. required List<PermissionType> supportedPermissionTypes,
  4. required String tableName,
  5. AuditContext? auditContext,
  6. String? expression,
  7. int? maxResults,
  8. String? nextToken,
  9. QuerySessionContext? querySessionContext,
  10. String? region,
  11. Segment? segment,
})

Retrieves partition metadata from the Data Catalog that contains unfiltered metadata.

For IAM authorization, the public IAM action associated with this API is glue:GetPartitions.

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

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

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

Parameter supportedPermissionTypes : A list of supported permission types.

Parameter tableName : The name of the table that contains the partition.

Parameter auditContext : A structure containing Lake Formation audit context information.

Parameter expression : An expression that filters the partitions to be returned.

The expression uses SQL syntax similar to the SQL WHERE filter clause. The SQL statement parser JSQLParser parses the expression.

Operators: The following are the operators that you can use in the Expression API call:

=
Checks whether the values of the two operands are equal; if yes, then the condition becomes true.

Example: Assume 'variable a' holds 10 and 'variable b' holds 20.

(a = b) is not true.

< >
Checks whether the values of two operands are equal; if the values are not equal, then the condition becomes true.

Example: (a < > b) is true.

>
Checks whether the value of the left operand is greater than the value of the right operand; if yes, then the condition becomes true.

Example: (a > b) is not true.

<
Checks whether the value of the left operand is less than the value of the right operand; if yes, then the condition becomes true.

Example: (a < b) is true.

>=
Checks whether the value of the left operand is greater than or equal to the value of the right operand; if yes, then the condition becomes true.

Example: (a >= b) is not true.

<=
Checks whether the value of the left operand is less than or equal to the value of the right operand; if yes, then the condition becomes true.

Example: (a <= b) is true.

AND, OR, IN, BETWEEN, LIKE, NOT, IS NULL
Logical operators.
Supported Partition Key Types: The following are the supported partition keys.
  • string
  • date
  • timestamp
  • int
  • bigint
  • long
  • tinyint
  • smallint
  • decimal
If an type is encountered that is not valid, an exception is thrown.

Parameter maxResults : The maximum number of partitions to return in a single response.

Parameter nextToken : A continuation token, if this is not the first call to retrieve these partitions.

Parameter querySessionContext : A structure used as a protocol between query engines and Lake Formation or Glue. Contains both a Lake Formation generated authorization identifier and information from the request's authorization context.

Parameter region : Specified only if the base tables belong to a different Amazon Web Services Region.

Parameter segment : The segment of the table's partitions to scan in this request.

Implementation

Future<GetUnfilteredPartitionsMetadataResponse>
    getUnfilteredPartitionsMetadata({
  required String catalogId,
  required String databaseName,
  required List<PermissionType> supportedPermissionTypes,
  required String tableName,
  AuditContext? auditContext,
  String? expression,
  int? maxResults,
  String? nextToken,
  QuerySessionContext? querySessionContext,
  String? region,
  Segment? segment,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetUnfilteredPartitionsMetadata'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CatalogId': catalogId,
      'DatabaseName': databaseName,
      'SupportedPermissionTypes':
          supportedPermissionTypes.map((e) => e.value).toList(),
      'TableName': tableName,
      if (auditContext != null) 'AuditContext': auditContext,
      if (expression != null) 'Expression': expression,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (querySessionContext != null)
        'QuerySessionContext': querySessionContext,
      if (region != null) 'Region': region,
      if (segment != null) 'Segment': segment,
    },
  );

  return GetUnfilteredPartitionsMetadataResponse.fromJson(jsonResponse.body);
}