Skip to content

create_column_statistics_task_settings

create_column_statistics_task_settings(
    database_name: NameString,
    table_name: NameString,
    role: NameString,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    schedule: Optional[CronExpression] = None,
    column_name_list: Optional[ColumnNameList] = None,
    sample_size: Optional[SampleSizePercentage] = None,
    catalog_id: Optional[CatalogIdString] = None,
    security_configuration: Optional[NameString] = None,
    tags: Optional[TagsMap] = None,
) -> CreateColumnStatisticsTaskSettingsResponse

Creates settings for a column statistics task.

Parameters:

  • database_name (NameString) –

    The name of the database where the table resides.

  • table_name (NameString) –

    The name of the table for which to generate column statistics.

  • role (NameString) –

    The role used for running the column statistics.

  • schedule (Optional[CronExpression], default: None ) –

    A schedule for running the column statistics, specified in CRON syntax.

  • column_name_list (Optional[ColumnNameList], default: None ) –

    A list of column names for which to run statistics.

  • sample_size (Optional[SampleSizePercentage], default: None ) –

    The percentage of data to sample.

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

    The ID of the Data Catalog in which the database resides.

  • security_configuration (Optional[NameString], default: None ) –

    Name of the security configuration that is used to encrypt CloudWatch logs.

  • tags (Optional[TagsMap], default: None ) –

    A map of tags.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def create_column_statistics_task_settings(
    self,
    database_name: "capo_glue.types.name_string.NameString",
    table_name: "capo_glue.types.name_string.NameString",
    role: "capo_glue.types.name_string.NameString",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    schedule: Optional["capo_glue.types.cron_expression.CronExpression"] = None,
    column_name_list: Optional[
        "capo_glue.types.column_name_list.ColumnNameList"
    ] = None,
    sample_size: Optional[
        "capo_glue.types.sample_size_percentage.SampleSizePercentage"
    ] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
    security_configuration: Optional[
        "capo_glue.types.name_string.NameString"
    ] = None,
    tags: Optional["capo_glue.types.tags_map.TagsMap"] = None,
) -> "capo_glue.types.create_column_statistics_task_settings_response.CreateColumnStatisticsTaskSettingsResponse":
    """<p>Creates settings for a column statistics task.</p>

    Args:
        database_name: <p>The name of the database where the table resides.</p>
        table_name: <p>The name of the table for which to generate column statistics.</p>
        role: <p>The role used for running the column statistics.</p>
        schedule: <p>A schedule for running the column statistics, specified in CRON syntax.</p>
        column_name_list: <p>A list of column names for which to run statistics.</p>
        sample_size: <p>The percentage of data to sample.</p>
        catalog_id: <p>The ID of the Data Catalog in which the database resides.</p>
        security_configuration: <p>Name of the security configuration that is used to encrypt CloudWatch logs.</p>
        tags: <p>A map of tags.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_glue.errors.already_exists_exception.AlreadyExistsException: <p>A resource to be created or added already exists.</p>
        capo_glue.errors.column_statistics_task_running_exception.ColumnStatisticsTaskRunningException: <p>An exception thrown when you try to start another job while running a column stats generation job.</p>
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</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.create_column_statistics_task_settings_request.CreateColumnStatisticsTaskSettingsRequest]",
    ) -> OperationResponse[
        "capo_glue.types.create_column_statistics_task_settings_response.CreateColumnStatisticsTaskSettingsResponse"
    ]:
        import capo_glue._operations.aws_glue.create_column_statistics_task_settings

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateColumnStatisticsTaskSettings")
    )
    input_: capo_glue.types.create_column_statistics_task_settings_request.CreateColumnStatisticsTaskSettingsRequest = {
        "database_name": database_name,
        "table_name": table_name,
        "role": role,
    }
    if schedule is not None:
        input_["schedule"] = schedule
    if column_name_list is not None:
        input_["column_name_list"] = column_name_list
    if sample_size is not None:
        input_["sample_size"] = sample_size
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id
    if security_configuration is not None:
        input_["security_configuration"] = security_configuration
    if tags is not None:
        input_["tags"] = tags

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