Skip to content

create_partition_index async

create_partition_index(
    database_name: NameString,
    table_name: NameString,
    partition_index: PartitionIndex,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
) -> CreatePartitionIndexResponse

Creates a specified partition index in an existing table.

Parameters:

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

    The catalog ID where the table resides.

  • database_name (NameString) –

    Specifies the name of a database in which you want to create a partition index.

  • table_name (NameString) –

    Specifies the name of a table in which you want to create a partition index.

  • partition_index (PartitionIndex) –

    Specifies a PartitionIndex structure to create a partition index in an existing table.

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def create_partition_index(
    self,
    database_name: "capo_glue.types.name_string.NameString",
    table_name: "capo_glue.types.name_string.NameString",
    partition_index: "capo_glue.types.partition_index.PartitionIndex",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
) -> "capo_glue.types.create_partition_index_response.CreatePartitionIndexResponse":
    """<p>Creates a specified partition index in an existing table.</p>

    Args:
        catalog_id: <p>The catalog ID where the table resides.</p>
        database_name: <p>Specifies the name of a database in which you want to create a partition index.</p>
        table_name: <p>Specifies the name of a table in which you want to create a partition index.</p>
        partition_index: <p>Specifies a <code>PartitionIndex</code> structure to create a partition index in an existing table.</p>

    Raises:
        capo_glue.errors.already_exists_exception.AlreadyExistsException: <p>A resource to be created or added already exists.</p>
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</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.resource_number_limit_exceeded_exception.ResourceNumberLimitExceededException: <p>A resource numerical limit was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.create_partition_index_request.CreatePartitionIndexRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.create_partition_index_response.CreatePartitionIndexResponse"
    ]:
        import capo_glue._operations.aws_glue.create_partition_index

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.create_partition_index.async_create_partition_index(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePartitionIndex")
    )
    input_: capo_glue.types.create_partition_index_request.CreatePartitionIndexRequest = {
        "database_name": database_name,
        "table_name": table_name,
        "partition_index": partition_index,
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output