Skip to content

batch_get_partition

batch_get_partition(
    database_name: NameString,
    table_name: NameString,
    partitions_to_get: BatchGetPartitionValueList,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
    audit_context: Optional[AuditContext] = None,
    query_session_context: Optional[QuerySessionContext] = None,
) -> BatchGetPartitionResponse

Retrieves partitions in a batch request.

Parameters:

  • catalog_id (Optional[CatalogIdString], default: None ) –

    The ID of the Data Catalog where the partitions in question reside. If none is supplied, the Amazon Web Services 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 partitions' table.

  • partitions_to_get (BatchGetPartitionValueList) –

    A list of partition values identifying the partitions to retrieve.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def batch_get_partition(
    self,
    database_name: "capo_glue.types.name_string.NameString",
    table_name: "capo_glue.types.name_string.NameString",
    partitions_to_get: "capo_glue.types.batch_get_partition_value_list.BatchGetPartitionValueList",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
    audit_context: Optional["capo_glue.types.audit_context.AuditContext"] = None,
    query_session_context: Optional[
        "capo_glue.types.query_session_context.QuerySessionContext"
    ] = None,
) -> "capo_glue.types.batch_get_partition_response.BatchGetPartitionResponse":
    """<p>Retrieves partitions in a batch request.</p>

    Args:
        catalog_id: <p>The ID of the Data Catalog where the partitions in question reside. If none is supplied, the Amazon Web Services 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 partitions' table.</p>
        partitions_to_get: <p>A list of partition values identifying the partitions to retrieve.</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.invalid_state_exception.InvalidStateException: <p>An error that indicates your data is in an invalid state.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <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.batch_get_partition_request.BatchGetPartitionRequest]",
    ) -> OperationResponse[
        "capo_glue.types.batch_get_partition_response.BatchGetPartitionResponse"
    ]:
        import capo_glue._operations.aws_glue.batch_get_partition

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchGetPartition")
    )
    input_: capo_glue.types.batch_get_partition_request.BatchGetPartitionRequest = {
        "database_name": database_name,
        "table_name": table_name,
        "partitions_to_get": partitions_to_get,
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id
    if audit_context is not None:
        input_["audit_context"] = audit_context
    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