AWS Glue

2024/09/12 - AWS Glue - 6 updated api methods

Changes  AWS Glue is introducing two new optimizers for Apache Iceberg tables: snapshot retention and orphan file deletion. Customers can enable these optimizers and customize their configurations to perform daily maintenance tasks on their Iceberg tables based on their specific requirements.

BatchGetTableOptimizer (updated) Link ¶
Changes (request, response)
Request
{'Entries': {'type': {'orphan_file_deletion', 'retention'}}}
Response
{'Failures': {'type': {'orphan_file_deletion', 'retention'}},
 'TableOptimizers': {'tableOptimizer': {'configuration': {'orphanFileDeletionConfiguration': {'icebergConfiguration': {'location': 'string',
                                                                                                                       'orphanFileRetentionPeriodInDays': 'integer'}},
                                                          'retentionConfiguration': {'icebergConfiguration': {'cleanExpiredFiles': 'boolean',
                                                                                                              'numberOfSnapshotsToRetain': 'integer',
                                                                                                              'snapshotRetentionPeriodInDays': 'integer'}}},
                                        'lastRun': {'compactionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                                             'NumberOfBytesCompacted': 'long',
                                                                                             'NumberOfDpus': 'integer',
                                                                                             'NumberOfFilesCompacted': 'long'}},
                                                    'orphanFileDeletionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                                                     'NumberOfDpus': 'integer',
                                                                                                     'NumberOfOrphanFilesDeleted': 'long'}},
                                                    'retentionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                                            'NumberOfDataFilesDeleted': 'long',
                                                                                            'NumberOfDpus': 'integer',
                                                                                            'NumberOfManifestFilesDeleted': 'long',
                                                                                            'NumberOfManifestListsDeleted': 'long'}}},
                                        'type': {'orphan_file_deletion',
                                                 'retention'}}}}

Returns the configuration for the specified table optimizers.

See also: AWS API Documentation

Request Syntax

client.batch_get_table_optimizer(
    Entries=[
        {
            'catalogId': 'string',
            'databaseName': 'string',
            'tableName': 'string',
            'type': 'compaction'|'retention'|'orphan_file_deletion'
        },
    ]
)
type Entries

list

param Entries

[REQUIRED]

A list of BatchGetTableOptimizerEntry objects specifying the table optimizers to retrieve.

  • (dict) --

    Represents a table optimizer to retrieve in the BatchGetTableOptimizer operation.

    • catalogId (string) --

      The Catalog ID of the table.

    • databaseName (string) --

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

    • tableName (string) --

      The name of the table.

    • type (string) --

      The type of table optimizer.

rtype

dict

returns

Response Syntax

{
    'TableOptimizers': [
        {
            'catalogId': 'string',
            'databaseName': 'string',
            'tableName': 'string',
            'tableOptimizer': {
                'type': 'compaction'|'retention'|'orphan_file_deletion',
                'configuration': {
                    'roleArn': 'string',
                    'enabled': True|False,
                    'retentionConfiguration': {
                        'icebergConfiguration': {
                            'snapshotRetentionPeriodInDays': 123,
                            'numberOfSnapshotsToRetain': 123,
                            'cleanExpiredFiles': True|False
                        }
                    },
                    'orphanFileDeletionConfiguration': {
                        'icebergConfiguration': {
                            'orphanFileRetentionPeriodInDays': 123,
                            'location': 'string'
                        }
                    }
                },
                'lastRun': {
                    'eventType': 'starting'|'completed'|'failed'|'in_progress',
                    'startTimestamp': datetime(2015, 1, 1),
                    'endTimestamp': datetime(2015, 1, 1),
                    'metrics': {
                        'NumberOfBytesCompacted': 'string',
                        'NumberOfFilesCompacted': 'string',
                        'NumberOfDpus': 'string',
                        'JobDurationInHour': 'string'
                    },
                    'error': 'string',
                    'compactionMetrics': {
                        'IcebergMetrics': {
                            'NumberOfBytesCompacted': 123,
                            'NumberOfFilesCompacted': 123,
                            'NumberOfDpus': 123,
                            'JobDurationInHour': 123.0
                        }
                    },
                    'retentionMetrics': {
                        'IcebergMetrics': {
                            'NumberOfDataFilesDeleted': 123,
                            'NumberOfManifestFilesDeleted': 123,
                            'NumberOfManifestListsDeleted': 123,
                            'NumberOfDpus': 123,
                            'JobDurationInHour': 123.0
                        }
                    },
                    'orphanFileDeletionMetrics': {
                        'IcebergMetrics': {
                            'NumberOfOrphanFilesDeleted': 123,
                            'NumberOfDpus': 123,
                            'JobDurationInHour': 123.0
                        }
                    }
                }
            }
        },
    ],
    'Failures': [
        {
            'error': {
                'ErrorCode': 'string',
                'ErrorMessage': 'string'
            },
            'catalogId': 'string',
            'databaseName': 'string',
            'tableName': 'string',
            'type': 'compaction'|'retention'|'orphan_file_deletion'
        },
    ]
}

Response Structure

  • (dict) --

    • TableOptimizers (list) --

      A list of BatchTableOptimizer objects.

      • (dict) --

        Contains details for one of the table optimizers returned by the BatchGetTableOptimizer operation.

        • catalogId (string) --

          The Catalog ID of the table.

        • databaseName (string) --

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

        • tableName (string) --

          The name of the table.

        • tableOptimizer (dict) --

          A TableOptimizer object that contains details on the configuration and last run of a table optimizer.

          • type (string) --

            The type of table optimizer. The valid values are:

            • compaction : for managing compaction with a table optimizer.

            • retention : for managing the retention of snapshot with a table optimizer.

            • orphan_file_deletion : for managing the deletion of orphan files with a table optimizer.

          • configuration (dict) --

            A TableOptimizerConfiguration object that was specified when creating or updating 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.

          • lastRun (dict) --

            A TableOptimizerRun object representing the last run of the table optimizer.

            • eventType (string) --

              An event type representing the status of the table optimizer run.

            • startTimestamp (datetime) --

              Represents the epoch timestamp at which the compaction job was started within Lake Formation.

            • endTimestamp (datetime) --

              Represents the epoch timestamp at which the compaction job ended.

            • metrics (dict) --

              A RunMetrics object containing metrics for the optimizer run.

              This member is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.

              • NumberOfBytesCompacted (string) --

                The number of bytes removed by the compaction job run.

              • NumberOfFilesCompacted (string) --

                The number of files removed by the compaction job run.

              • NumberOfDpus (string) --

                The number of DPU hours consumed by the job.

              • JobDurationInHour (string) --

                The duration of the job in hours.

            • error (string) --

              An error that occured during the optimizer run.

            • compactionMetrics (dict) --

              A CompactionMetrics object containing metrics for the optimizer run.

              • IcebergMetrics (dict) --

                A structure containing the Iceberg compaction metrics for the optimizer run.

                • NumberOfBytesCompacted (integer) --

                  The number of bytes removed by the compaction job run.

                • NumberOfFilesCompacted (integer) --

                  The number of files removed by the compaction job run.

                • NumberOfDpus (integer) --

                  The number of DPU hours consumed by the job.

                • JobDurationInHour (float) --

                  The duration of the job in hours.

            • retentionMetrics (dict) --

              A RetentionMetrics object containing metrics for the optimizer run.

              • IcebergMetrics (dict) --

                A structure containing the Iceberg retention metrics for the optimizer run.

                • NumberOfDataFilesDeleted (integer) --

                  The number of data files deleted by the retention job run.

                • NumberOfManifestFilesDeleted (integer) --

                  The number of manifest files deleted by the retention job run.

                • NumberOfManifestListsDeleted (integer) --

                  The number of manifest lists deleted by the retention job run.

                • NumberOfDpus (integer) --

                  The number of DPU hours consumed by the job.

                • JobDurationInHour (float) --

                  The duration of the job in hours.

            • orphanFileDeletionMetrics (dict) --

              An OrphanFileDeletionMetrics object containing metrics for the optimizer run.

              • IcebergMetrics (dict) --

                A structure containing the Iceberg orphan file deletion metrics for the optimizer run.

                • NumberOfOrphanFilesDeleted (integer) --

                  The number of orphan files deleted by the orphan file deletion job run.

                • NumberOfDpus (integer) --

                  The number of DPU hours consumed by the job.

                • JobDurationInHour (float) --

                  The duration of the job in hours.

    • Failures (list) --

      A list of errors from the operation.

      • (dict) --

        Contains details on one of the errors in the error list returned by the BatchGetTableOptimizer operation.

        • error (dict) --

          An ErrorDetail object containing code and message details about the error.

          • ErrorCode (string) --

            The code associated with this error.

          • ErrorMessage (string) --

            A message describing the error.

        • catalogId (string) --

          The Catalog ID of the table.

        • databaseName (string) --

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

        • tableName (string) --

          The name of the table.

        • type (string) --

          The type of table optimizer.

CreateTableOptimizer (updated) Link ¶
Changes (request)
{'TableOptimizerConfiguration': {'orphanFileDeletionConfiguration': {'icebergConfiguration': {'location': 'string',
                                                                                              'orphanFileRetentionPeriodInDays': 'integer'}},
                                 'retentionConfiguration': {'icebergConfiguration': {'cleanExpiredFiles': 'boolean',
                                                                                     'numberOfSnapshotsToRetain': 'integer',
                                                                                     'snapshotRetentionPeriodInDays': 'integer'}}},
 'Type': {'orphan_file_deletion', 'retention'}}

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

See also: AWS API Documentation

Request Syntax

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'
            }
        }
    }
)
type CatalogId

string

param CatalogId

[REQUIRED]

The Catalog ID of the table.

type DatabaseName

string

param DatabaseName

[REQUIRED]

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

type TableName

string

param TableName

[REQUIRED]

The name of the table.

type Type

string

param Type

[REQUIRED]

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

type TableOptimizerConfiguration

dict

param TableOptimizerConfiguration

[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.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

DeleteTableOptimizer (updated) Link ¶
Changes (request)
{'Type': {'orphan_file_deletion', 'retention'}}

Deletes an optimizer and all associated metadata for a table. The optimization will no longer be performed on the table.

See also: AWS API Documentation

Request Syntax

client.delete_table_optimizer(
    CatalogId='string',
    DatabaseName='string',
    TableName='string',
    Type='compaction'|'retention'|'orphan_file_deletion'
)
type CatalogId

string

param CatalogId

[REQUIRED]

The Catalog ID of the table.

type DatabaseName

string

param DatabaseName

[REQUIRED]

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

type TableName

string

param TableName

[REQUIRED]

The name of the table.

type Type

string

param Type

[REQUIRED]

The type of table optimizer.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

GetTableOptimizer (updated) Link ¶
Changes (request, response)
Request
{'Type': {'orphan_file_deletion', 'retention'}}
Response
{'TableOptimizer': {'configuration': {'orphanFileDeletionConfiguration': {'icebergConfiguration': {'location': 'string',
                                                                                                   'orphanFileRetentionPeriodInDays': 'integer'}},
                                      'retentionConfiguration': {'icebergConfiguration': {'cleanExpiredFiles': 'boolean',
                                                                                          'numberOfSnapshotsToRetain': 'integer',
                                                                                          'snapshotRetentionPeriodInDays': 'integer'}}},
                    'lastRun': {'compactionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                         'NumberOfBytesCompacted': 'long',
                                                                         'NumberOfDpus': 'integer',
                                                                         'NumberOfFilesCompacted': 'long'}},
                                'orphanFileDeletionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                                 'NumberOfDpus': 'integer',
                                                                                 'NumberOfOrphanFilesDeleted': 'long'}},
                                'retentionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                        'NumberOfDataFilesDeleted': 'long',
                                                                        'NumberOfDpus': 'integer',
                                                                        'NumberOfManifestFilesDeleted': 'long',
                                                                        'NumberOfManifestListsDeleted': 'long'}}},
                    'type': {'orphan_file_deletion', 'retention'}}}

Returns the configuration of all optimizers associated with a specified table.

See also: AWS API Documentation

Request Syntax

client.get_table_optimizer(
    CatalogId='string',
    DatabaseName='string',
    TableName='string',
    Type='compaction'|'retention'|'orphan_file_deletion'
)
type CatalogId

string

param CatalogId

[REQUIRED]

The Catalog ID of the table.

type DatabaseName

string

param DatabaseName

[REQUIRED]

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

type TableName

string

param TableName

[REQUIRED]

The name of the table.

type Type

string

param Type

[REQUIRED]

The type of table optimizer.

rtype

dict

returns

Response Syntax

{
    'CatalogId': 'string',
    'DatabaseName': 'string',
    'TableName': 'string',
    'TableOptimizer': {
        'type': 'compaction'|'retention'|'orphan_file_deletion',
        'configuration': {
            'roleArn': 'string',
            'enabled': True|False,
            'retentionConfiguration': {
                'icebergConfiguration': {
                    'snapshotRetentionPeriodInDays': 123,
                    'numberOfSnapshotsToRetain': 123,
                    'cleanExpiredFiles': True|False
                }
            },
            'orphanFileDeletionConfiguration': {
                'icebergConfiguration': {
                    'orphanFileRetentionPeriodInDays': 123,
                    'location': 'string'
                }
            }
        },
        'lastRun': {
            'eventType': 'starting'|'completed'|'failed'|'in_progress',
            'startTimestamp': datetime(2015, 1, 1),
            'endTimestamp': datetime(2015, 1, 1),
            'metrics': {
                'NumberOfBytesCompacted': 'string',
                'NumberOfFilesCompacted': 'string',
                'NumberOfDpus': 'string',
                'JobDurationInHour': 'string'
            },
            'error': 'string',
            'compactionMetrics': {
                'IcebergMetrics': {
                    'NumberOfBytesCompacted': 123,
                    'NumberOfFilesCompacted': 123,
                    'NumberOfDpus': 123,
                    'JobDurationInHour': 123.0
                }
            },
            'retentionMetrics': {
                'IcebergMetrics': {
                    'NumberOfDataFilesDeleted': 123,
                    'NumberOfManifestFilesDeleted': 123,
                    'NumberOfManifestListsDeleted': 123,
                    'NumberOfDpus': 123,
                    'JobDurationInHour': 123.0
                }
            },
            'orphanFileDeletionMetrics': {
                'IcebergMetrics': {
                    'NumberOfOrphanFilesDeleted': 123,
                    'NumberOfDpus': 123,
                    'JobDurationInHour': 123.0
                }
            }
        }
    }
}

Response Structure

  • (dict) --

    • CatalogId (string) --

      The Catalog ID of the table.

    • DatabaseName (string) --

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

    • TableName (string) --

      The name of the table.

    • TableOptimizer (dict) --

      The optimizer associated with the specified table.

      • type (string) --

        The type of table optimizer. The valid values are:

        • compaction : for managing compaction with a table optimizer.

        • retention : for managing the retention of snapshot with a table optimizer.

        • orphan_file_deletion : for managing the deletion of orphan files with a table optimizer.

      • configuration (dict) --

        A TableOptimizerConfiguration object that was specified when creating or updating 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.

      • lastRun (dict) --

        A TableOptimizerRun object representing the last run of the table optimizer.

        • eventType (string) --

          An event type representing the status of the table optimizer run.

        • startTimestamp (datetime) --

          Represents the epoch timestamp at which the compaction job was started within Lake Formation.

        • endTimestamp (datetime) --

          Represents the epoch timestamp at which the compaction job ended.

        • metrics (dict) --

          A RunMetrics object containing metrics for the optimizer run.

          This member is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.

          • NumberOfBytesCompacted (string) --

            The number of bytes removed by the compaction job run.

          • NumberOfFilesCompacted (string) --

            The number of files removed by the compaction job run.

          • NumberOfDpus (string) --

            The number of DPU hours consumed by the job.

          • JobDurationInHour (string) --

            The duration of the job in hours.

        • error (string) --

          An error that occured during the optimizer run.

        • compactionMetrics (dict) --

          A CompactionMetrics object containing metrics for the optimizer run.

          • IcebergMetrics (dict) --

            A structure containing the Iceberg compaction metrics for the optimizer run.

            • NumberOfBytesCompacted (integer) --

              The number of bytes removed by the compaction job run.

            • NumberOfFilesCompacted (integer) --

              The number of files removed by the compaction job run.

            • NumberOfDpus (integer) --

              The number of DPU hours consumed by the job.

            • JobDurationInHour (float) --

              The duration of the job in hours.

        • retentionMetrics (dict) --

          A RetentionMetrics object containing metrics for the optimizer run.

          • IcebergMetrics (dict) --

            A structure containing the Iceberg retention metrics for the optimizer run.

            • NumberOfDataFilesDeleted (integer) --

              The number of data files deleted by the retention job run.

            • NumberOfManifestFilesDeleted (integer) --

              The number of manifest files deleted by the retention job run.

            • NumberOfManifestListsDeleted (integer) --

              The number of manifest lists deleted by the retention job run.

            • NumberOfDpus (integer) --

              The number of DPU hours consumed by the job.

            • JobDurationInHour (float) --

              The duration of the job in hours.

        • orphanFileDeletionMetrics (dict) --

          An OrphanFileDeletionMetrics object containing metrics for the optimizer run.

          • IcebergMetrics (dict) --

            A structure containing the Iceberg orphan file deletion metrics for the optimizer run.

            • NumberOfOrphanFilesDeleted (integer) --

              The number of orphan files deleted by the orphan file deletion job run.

            • NumberOfDpus (integer) --

              The number of DPU hours consumed by the job.

            • JobDurationInHour (float) --

              The duration of the job in hours.

ListTableOptimizerRuns (updated) Link ¶
Changes (request, response)
Request
{'Type': {'orphan_file_deletion', 'retention'}}
Response
{'TableOptimizerRuns': {'compactionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                 'NumberOfBytesCompacted': 'long',
                                                                 'NumberOfDpus': 'integer',
                                                                 'NumberOfFilesCompacted': 'long'}},
                        'orphanFileDeletionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                         'NumberOfDpus': 'integer',
                                                                         'NumberOfOrphanFilesDeleted': 'long'}},
                        'retentionMetrics': {'IcebergMetrics': {'JobDurationInHour': 'double',
                                                                'NumberOfDataFilesDeleted': 'long',
                                                                'NumberOfDpus': 'integer',
                                                                'NumberOfManifestFilesDeleted': 'long',
                                                                'NumberOfManifestListsDeleted': 'long'}}}}

Lists the history of previous optimizer runs for a specific table.

See also: AWS API Documentation

Request Syntax

client.list_table_optimizer_runs(
    CatalogId='string',
    DatabaseName='string',
    TableName='string',
    Type='compaction'|'retention'|'orphan_file_deletion',
    MaxResults=123,
    NextToken='string'
)
type CatalogId

string

param CatalogId

[REQUIRED]

The Catalog ID of the table.

type DatabaseName

string

param DatabaseName

[REQUIRED]

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

type TableName

string

param TableName

[REQUIRED]

The name of the table.

type Type

string

param Type

[REQUIRED]

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

type MaxResults

integer

param MaxResults

The maximum number of optimizer runs to return on each call.

type NextToken

string

param NextToken

A continuation token, if this is a continuation call.

rtype

dict

returns

Response Syntax

{
    'CatalogId': 'string',
    'DatabaseName': 'string',
    'TableName': 'string',
    'NextToken': 'string',
    'TableOptimizerRuns': [
        {
            'eventType': 'starting'|'completed'|'failed'|'in_progress',
            'startTimestamp': datetime(2015, 1, 1),
            'endTimestamp': datetime(2015, 1, 1),
            'metrics': {
                'NumberOfBytesCompacted': 'string',
                'NumberOfFilesCompacted': 'string',
                'NumberOfDpus': 'string',
                'JobDurationInHour': 'string'
            },
            'error': 'string',
            'compactionMetrics': {
                'IcebergMetrics': {
                    'NumberOfBytesCompacted': 123,
                    'NumberOfFilesCompacted': 123,
                    'NumberOfDpus': 123,
                    'JobDurationInHour': 123.0
                }
            },
            'retentionMetrics': {
                'IcebergMetrics': {
                    'NumberOfDataFilesDeleted': 123,
                    'NumberOfManifestFilesDeleted': 123,
                    'NumberOfManifestListsDeleted': 123,
                    'NumberOfDpus': 123,
                    'JobDurationInHour': 123.0
                }
            },
            'orphanFileDeletionMetrics': {
                'IcebergMetrics': {
                    'NumberOfOrphanFilesDeleted': 123,
                    'NumberOfDpus': 123,
                    'JobDurationInHour': 123.0
                }
            }
        },
    ]
}

Response Structure

  • (dict) --

    • CatalogId (string) --

      The Catalog ID of the table.

    • DatabaseName (string) --

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

    • TableName (string) --

      The name of the table.

    • NextToken (string) --

      A continuation token for paginating the returned list of optimizer runs, returned if the current segment of the list is not the last.

    • TableOptimizerRuns (list) --

      A list of the optimizer runs associated with a table.

      • (dict) --

        Contains details for a table optimizer run.

        • eventType (string) --

          An event type representing the status of the table optimizer run.

        • startTimestamp (datetime) --

          Represents the epoch timestamp at which the compaction job was started within Lake Formation.

        • endTimestamp (datetime) --

          Represents the epoch timestamp at which the compaction job ended.

        • metrics (dict) --

          A RunMetrics object containing metrics for the optimizer run.

          This member is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.

          • NumberOfBytesCompacted (string) --

            The number of bytes removed by the compaction job run.

          • NumberOfFilesCompacted (string) --

            The number of files removed by the compaction job run.

          • NumberOfDpus (string) --

            The number of DPU hours consumed by the job.

          • JobDurationInHour (string) --

            The duration of the job in hours.

        • error (string) --

          An error that occured during the optimizer run.

        • compactionMetrics (dict) --

          A CompactionMetrics object containing metrics for the optimizer run.

          • IcebergMetrics (dict) --

            A structure containing the Iceberg compaction metrics for the optimizer run.

            • NumberOfBytesCompacted (integer) --

              The number of bytes removed by the compaction job run.

            • NumberOfFilesCompacted (integer) --

              The number of files removed by the compaction job run.

            • NumberOfDpus (integer) --

              The number of DPU hours consumed by the job.

            • JobDurationInHour (float) --

              The duration of the job in hours.

        • retentionMetrics (dict) --

          A RetentionMetrics object containing metrics for the optimizer run.

          • IcebergMetrics (dict) --

            A structure containing the Iceberg retention metrics for the optimizer run.

            • NumberOfDataFilesDeleted (integer) --

              The number of data files deleted by the retention job run.

            • NumberOfManifestFilesDeleted (integer) --

              The number of manifest files deleted by the retention job run.

            • NumberOfManifestListsDeleted (integer) --

              The number of manifest lists deleted by the retention job run.

            • NumberOfDpus (integer) --

              The number of DPU hours consumed by the job.

            • JobDurationInHour (float) --

              The duration of the job in hours.

        • orphanFileDeletionMetrics (dict) --

          An OrphanFileDeletionMetrics object containing metrics for the optimizer run.

          • IcebergMetrics (dict) --

            A structure containing the Iceberg orphan file deletion metrics for the optimizer run.

            • NumberOfOrphanFilesDeleted (integer) --

              The number of orphan files deleted by the orphan file deletion job run.

            • NumberOfDpus (integer) --

              The number of DPU hours consumed by the job.

            • JobDurationInHour (float) --

              The duration of the job in hours.

UpdateTableOptimizer (updated) Link ¶
Changes (request)
{'TableOptimizerConfiguration': {'orphanFileDeletionConfiguration': {'icebergConfiguration': {'location': 'string',
                                                                                              'orphanFileRetentionPeriodInDays': 'integer'}},
                                 'retentionConfiguration': {'icebergConfiguration': {'cleanExpiredFiles': 'boolean',
                                                                                     'numberOfSnapshotsToRetain': 'integer',
                                                                                     'snapshotRetentionPeriodInDays': 'integer'}}},
 'Type': {'orphan_file_deletion', 'retention'}}

Updates the configuration for an existing table optimizer.

See also: AWS API Documentation

Request Syntax

client.update_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'
            }
        }
    }
)
type CatalogId

string

param CatalogId

[REQUIRED]

The Catalog ID of the table.

type DatabaseName

string

param DatabaseName

[REQUIRED]

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

type TableName

string

param TableName

[REQUIRED]

The name of the table.

type Type

string

param Type

[REQUIRED]

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

type TableOptimizerConfiguration

dict

param TableOptimizerConfiguration

[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.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --