Skip to content

batch_create_partition

batch_create_partition(
    database_name: NameString,
    table_name: NameString,
    partition_input_list: PartitionInputList,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
) -> BatchCreatePartitionResponse

Creates one or more partitions in a batch operation.

Parameters:

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

    The ID of the catalog in which the partition is to be created. Currently, this should be the Amazon Web Services account ID.

  • database_name (NameString) –

    The name of the metadata database in which the partition is to be created.

  • table_name (NameString) –

    The name of the metadata table in which the partition is to be created.

  • partition_input_list (PartitionInputList) –

    A list of PartitionInput structures that define the partitions to be created.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def batch_create_partition(
    self,
    database_name: "capo_glue.types.name_string.NameString",
    table_name: "capo_glue.types.name_string.NameString",
    partition_input_list: "capo_glue.types.partition_input_list.PartitionInputList",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
) -> "capo_glue.types.batch_create_partition_response.BatchCreatePartitionResponse":
    """<p>Creates one or more partitions in a batch operation.</p>

    Args:
        catalog_id: <p>The ID of the catalog in which the partition is to be created. Currently, this should be the Amazon Web Services account ID.</p>
        database_name: <p>The name of the metadata database in which the partition is to be created.</p>
        table_name: <p>The name of the metadata table in which the partition is to be created.</p>
        partition_input_list: <p>A list of <code>PartitionInput</code> structures that define the partitions to be created.</p>

    Raises:
        capo_glue.errors.already_exists_exception.AlreadyExistsException: <p>A resource to be created or added already exists.</p>
        capo_glue.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Two processes are trying to modify a resource simultaneously.</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.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.batch_create_partition_request.BatchCreatePartitionRequest]",
    ) -> OperationResponse[
        "capo_glue.types.batch_create_partition_response.BatchCreatePartitionResponse"
    ]:
        import capo_glue._operations.aws_glue.batch_create_partition

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchCreatePartition")
    )
    input_: capo_glue.types.batch_create_partition_request.BatchCreatePartitionRequest = {
        "database_name": database_name,
        "table_name": table_name,
        "partition_input_list": partition_input_list,
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id

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