Glue / Client / create_table_optimizer

create_table_optimizer#

Glue.Client.create_table_optimizer(**kwargs)#

Creates a new table optimizer for a specific function. compaction is the only currently supported optimizer type.

See also: AWS API Documentation

Request Syntax

response = client.create_table_optimizer(
    CatalogId='string',
    DatabaseName='string',
    TableName='string',
    Type='compaction'|'retention'|'orphan_file_deletion',
    TableOptimizerConfiguration={
        'roleArn': 'string',
        'enabled': True|False,
        'retentionConfiguration': {
            'icebergConfiguration': {
                'snapshotRetentionPeriodInDays': 123,
                'numberOfSnapshotsToRetain': 123,
                'cleanExpiredFiles': True|False
            }
        },
        'orphanFileDeletionConfiguration': {
            'icebergConfiguration': {
                'orphanFileRetentionPeriodInDays': 123,
                'location': 'string'
            }
        }
    }
)
Parameters:
  • CatalogId (string) –

    [REQUIRED]

    The Catalog ID of the table.

  • DatabaseName (string) –

    [REQUIRED]

    The name of the database in the catalog in which the table resides.

  • TableName (string) –

    [REQUIRED]

    The name of the table.

  • Type (string) –

    [REQUIRED]

    The type of table optimizer. Currently, the only valid value is compaction.

  • TableOptimizerConfiguration (dict) –

    [REQUIRED]

    A TableOptimizerConfiguration object representing the configuration of a table optimizer.

    • roleArn (string) –

      A role passed by the caller which gives the service permission to update the resources associated with the optimizer on the caller’s behalf.

    • enabled (boolean) –

      Whether table optimization is enabled.

    • retentionConfiguration (dict) –

      The configuration for a snapshot retention optimizer.

      • icebergConfiguration (dict) –

        The configuration for an Iceberg snapshot retention optimizer.

        • snapshotRetentionPeriodInDays (integer) –

          The number of days to retain the Iceberg snapshots. If an input is not provided, the corresponding Iceberg table configuration field will be used or if not present, the default value 5 will be used.

        • numberOfSnapshotsToRetain (integer) –

          The number of Iceberg snapshots to retain within the retention period. If an input is not provided, the corresponding Iceberg table configuration field will be used or if not present, the default value 1 will be used.

        • cleanExpiredFiles (boolean) –

          If set to false, snapshots are only deleted from table metadata, and the underlying data and metadata files are not deleted.

    • orphanFileDeletionConfiguration (dict) –

      The configuration for an orphan file deletion optimizer.

      • icebergConfiguration (dict) –

        The configuration for an Iceberg orphan file deletion optimizer.

        • orphanFileRetentionPeriodInDays (integer) –

          The number of days that orphan files should be retained before file deletion. If an input is not provided, the default value 3 will be used.

        • location (string) –

          Specifies a directory in which to look for files (defaults to the table’s location). You may choose a sub-directory rather than the top-level table location.

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions

  • Glue.Client.exceptions.EntityNotFoundException

  • Glue.Client.exceptions.ValidationException

  • Glue.Client.exceptions.InvalidInputException

  • Glue.Client.exceptions.AccessDeniedException

  • Glue.Client.exceptions.AlreadyExistsException

  • Glue.Client.exceptions.InternalServiceException

  • Glue.Client.exceptions.ThrottlingException