Skip to content

get_unfiltered_partitions_metadata

get_unfiltered_partitions_metadata(
    catalog_id: CatalogIdString,
    database_name: NameString,
    table_name: NameString,
    supported_permission_types: PermissionTypeList,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    region: Optional[ValueString] = None,
    expression: Optional[PredicateString] = None,
    audit_context: Optional[AuditContext] = None,
    next_token: Optional[Token] = None,
    segment: Optional[Segment] = None,
    max_results: Optional[PageSize] = None,
    query_session_context: Optional[QuerySessionContext] = None,
) -> GetUnfilteredPartitionsMetadataResponse

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.

Parameters:

  • region (Optional[ValueString], default: None ) –

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

  • catalog_id (CatalogIdString) –

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

  • database_name (NameString) –

    The name of the catalog database where the partitions reside.

  • table_name (NameString) –

    The name of the table that contains the partition.

  • expression (Optional[PredicateString], default: None ) –

    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.

  • audit_context (Optional[AuditContext], default: None ) –

    A structure containing Lake Formation audit context information.

  • supported_permission_types (PermissionTypeList) –

    A list of supported permission types.

  • next_token (Optional[Token], default: None ) –

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

  • segment (Optional[Segment], default: None ) –

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

  • max_results (Optional[PageSize], default: None ) –

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

  • query_session_context (Optional[QuerySessionContext], default: None ) –

    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.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def get_unfiltered_partitions_metadata(
    self,
    catalog_id: "capo_glue.types.catalog_id_string.CatalogIdString",
    database_name: "capo_glue.types.name_string.NameString",
    table_name: "capo_glue.types.name_string.NameString",
    supported_permission_types: "capo_glue.types.permission_type_list.PermissionTypeList",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    region: Optional["capo_glue.types.value_string.ValueString"] = None,
    expression: Optional["capo_glue.types.predicate_string.PredicateString"] = None,
    audit_context: Optional["capo_glue.types.audit_context.AuditContext"] = None,
    next_token: Optional["capo_glue.types.token.Token"] = None,
    segment: Optional["capo_glue.types.segment.Segment"] = None,
    max_results: Optional["capo_glue.types.page_size.PageSize"] = None,
    query_session_context: Optional[
        "capo_glue.types.query_session_context.QuerySessionContext"
    ] = None,
) -> "capo_glue.types.get_unfiltered_partitions_metadata_response.GetUnfilteredPartitionsMetadataResponse":
    """<p>Retrieves partition metadata from the Data Catalog that contains unfiltered metadata.</p> <p>For IAM authorization, the public IAM action associated with this API is <code>glue:GetPartitions</code>.</p>

    Args:
        region: <p>Specified only if the base tables belong to a different Amazon Web Services Region.</p>
        catalog_id: <p>The ID of the Data Catalog where the partitions in question reside. If none is provided, the AWS account ID is used by default. </p>
        database_name: <p>The name of the catalog database where the partitions reside.</p>
        table_name: <p>The name of the table that contains the partition.</p>
        expression: <p>An expression that filters the partitions to be returned.</p> <p>The expression uses SQL syntax similar to the SQL <code>WHERE</code> filter clause. The SQL statement parser <a href="http://jsqlparser.sourceforge.net/home.php">JSQLParser</a> parses the expression. </p> <p> <i>Operators</i>: The following are the operators that you can use in the <code>Expression</code> API call:</p> <dl> <dt>=</dt> <dd> <p>Checks whether the values of the two operands are equal; if yes, then the condition becomes true.</p> <p>Example: Assume 'variable a' holds 10 and 'variable b' holds 20. </p> <p>(a = b) is not true.</p> </dd> <dt>< ></dt> <dd> <p>Checks whether the values of two operands are equal; if the values are not equal, then the condition becomes true.</p> <p>Example: (a < > b) is true.</p> </dd> <dt>></dt> <dd> <p>Checks whether the value of the left operand is greater than the value of the right operand; if yes, then the condition becomes true.</p> <p>Example: (a > b) is not true.</p> </dd> <dt><</dt> <dd> <p>Checks whether the value of the left operand is less than the value of the right operand; if yes, then the condition becomes true.</p> <p>Example: (a < b) is true.</p> </dd> <dt>>=</dt> <dd> <p>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.</p> <p>Example: (a >= b) is not true.</p> </dd> <dt><=</dt> <dd> <p>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.</p> <p>Example: (a <= b) is true.</p> </dd> <dt>AND, OR, IN, BETWEEN, LIKE, NOT, IS NULL</dt> <dd> <p>Logical operators.</p> </dd> </dl> <p> <i>Supported Partition Key Types</i>: The following are the supported partition keys.</p> <ul> <li> <p> <code>string</code> </p> </li> <li> <p> <code>date</code> </p> </li> <li> <p> <code>timestamp</code> </p> </li> <li> <p> <code>int</code> </p> </li> <li> <p> <code>bigint</code> </p> </li> <li> <p> <code>long</code> </p> </li> <li> <p> <code>tinyint</code> </p> </li> <li> <p> <code>smallint</code> </p> </li> <li> <p> <code>decimal</code> </p> </li> </ul> <p>If an type is encountered that is not valid, an exception is thrown. </p>
        audit_context: <p>A structure containing Lake Formation audit context information.</p>
        supported_permission_types: <p>A list of supported permission types. </p>
        next_token: <p>A continuation token, if this is not the first call to retrieve these partitions.</p>
        segment: <p>The segment of the table's partitions to scan in this request.</p>
        max_results: <p>The maximum number of partitions to return in a single response.</p>
        query_session_context: <p>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.</p>

    Raises:
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.federation_source_exception.FederationSourceException: <p>A federation source failed.</p>
        capo_glue.errors.federation_source_retryable_exception.FederationSourceRetryableException: <p>A federation source failed, but the operation may be retried.</p>
        capo_glue.errors.glue_encryption_exception.GlueEncryptionException: <p>An encryption operation failed.</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.permission_type_mismatch_exception.PermissionTypeMismatchException: <p>The operation timed out.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.get_unfiltered_partitions_metadata_request.GetUnfilteredPartitionsMetadataRequest]",
    ) -> OperationResponse[
        "capo_glue.types.get_unfiltered_partitions_metadata_response.GetUnfilteredPartitionsMetadataResponse"
    ]:
        import capo_glue._operations.aws_glue.get_unfiltered_partitions_metadata

        output, http_response = (
            capo_glue._operations.aws_glue.get_unfiltered_partitions_metadata.get_unfiltered_partitions_metadata(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetUnfilteredPartitionsMetadata")
    )
    input_: capo_glue.types.get_unfiltered_partitions_metadata_request.GetUnfilteredPartitionsMetadataRequest = {
        "catalog_id": catalog_id,
        "database_name": database_name,
        "table_name": table_name,
        "supported_permission_types": supported_permission_types,
    }
    if region is not None:
        input_["region"] = region
    if expression is not None:
        input_["expression"] = expression
    if audit_context is not None:
        input_["audit_context"] = audit_context
    if next_token is not None:
        input_["next_token"] = next_token
    if segment is not None:
        input_["segment"] = segment
    if max_results is not None:
        input_["max_results"] = max_results
    if query_session_context is not None:
        input_["query_session_context"] = query_session_context

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output