Table optimizer API
The table optimizer API describes the Amazon Glue API for enabling compaction to improve read performance.
Data types
TableOptimizer structure
Contains details about an optimizer associated with a table.
Fields
-
type
– UTF-8 string (valid values:compaction="COMPACTION"
|retention="RETENTION"
|orphan_file_deletion="ORPHAN_FILE_DELETION"
).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
– A TableOptimizerConfiguration object.A
TableOptimizerConfiguration
object that was specified when creating or updating a table optimizer. -
lastRun
– A TableOptimizerRun object.A
TableOptimizerRun
object representing the last run of the table optimizer.
TableOptimizerConfiguration structure
Contains details on the configuration of a table optimizer. You pass this configuration when creating or updating a table optimizer.
Fields
-
roleArn
– UTF-8 string, not less than 20 or more than 2048 bytes long, matching the Single-line string pattern.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.
-
vpcConfiguration
– A TableOptimizerVpcConfiguration object.A
TableOptimizerVpcConfiguration
object representing the VPC configuration for a table optimizer.This configuration is necessary to perform optimization on tables that are in a customer VPC.
-
retentionConfiguration
– A RetentionConfiguration object.The configuration for a snapshot retention optimizer.
-
orphanFileDeletionConfiguration
– An OrphanFileDeletionConfiguration object.The configuration for an orphan file deletion optimizer.
TableOptimizerVpcConfiguration structure
An object that describes the VPC configuration for a table optimizer.
This configuration is necessary to perform optimization on tables that are in a customer VPC.
Fields
-
glueConnectionName
– UTF-8 string, at least 1 byte long.The name of the Amazon Glue connection used for the VPC for the table optimizer.
TableOptimizerRun structure
Contains details for a table optimizer run.
Fields
-
eventType
– UTF-8 string (valid values:starting="STARTING"
|completed="COMPLETED"
|failed="FAILED"
|in_progress="IN_PROGRESS"
).An event type representing the status of the table optimizer run.
-
startTimestamp
– Timestamp.Represents the epoch timestamp at which the compaction job was started within Lake Formation.
-
endTimestamp
– Timestamp.Represents the epoch timestamp at which the compaction job ended.
-
metrics
– A RunMetrics object.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.
-
error
– UTF-8 string.An error that occured during the optimizer run.
-
compactionMetrics
– A CompactionMetrics object.A
CompactionMetrics
object containing metrics for the optimizer run. -
retentionMetrics
– A RetentionMetrics object.A
RetentionMetrics
object containing metrics for the optimizer run. -
orphanFileDeletionMetrics
– An OrphanFileDeletionMetrics object.An
OrphanFileDeletionMetrics
object containing metrics for the optimizer run.
BatchGetTableOptimizerEntry structure
Represents a table optimizer to retrieve in the BatchGetTableOptimizer
operation.
Fields
-
catalogId
– Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
databaseName
– UTF-8 string, at least 1 byte long.The name of the database in the catalog in which the table resides.
-
tableName
– UTF-8 string, at least 1 byte long.The name of the table.
-
type
– UTF-8 string (valid values:compaction="COMPACTION"
|retention="RETENTION"
|orphan_file_deletion="ORPHAN_FILE_DELETION"
).The type of table optimizer.
BatchTableOptimizer structure
Contains details for one of the table optimizers returned by the BatchGetTableOptimizer
operation.
Fields
-
catalogId
– Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
databaseName
– UTF-8 string, at least 1 byte long.The name of the database in the catalog in which the table resides.
-
tableName
– UTF-8 string, at least 1 byte long.The name of the table.
-
tableOptimizer
– A TableOptimizer object.A
TableOptimizer
object that contains details on the configuration and last run of a table optimizer.
BatchGetTableOptimizerError structure
Contains details on one of the errors in the error list returned by the BatchGetTableOptimizer
operation.
Fields
-
error
– An ErrorDetail object.An
ErrorDetail
object containing code and message details about the error. -
catalogId
– Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
databaseName
– UTF-8 string, at least 1 byte long.The name of the database in the catalog in which the table resides.
-
tableName
– UTF-8 string, at least 1 byte long.The name of the table.
-
type
– UTF-8 string (valid values:compaction="COMPACTION"
|retention="RETENTION"
|orphan_file_deletion="ORPHAN_FILE_DELETION"
).The type of table optimizer.
RetentionConfiguration structure
The configuration for a snapshot retention optimizer.
Fields
-
icebergConfiguration
– An IcebergRetentionConfiguration object.The configuration for an Iceberg snapshot retention optimizer.
IcebergRetentionConfiguration structure
The configuration for an Iceberg snapshot retention optimizer.
Fields
-
snapshotRetentionPeriodInDays
– Number (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
– Number (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 structure
The configuration for an orphan file deletion optimizer.
Fields
-
icebergConfiguration
– An IcebergOrphanFileDeletionConfiguration object.The configuration for an Iceberg orphan file deletion optimizer.
IcebergOrphanFileDeletionConfiguration structure
The configuration for an Iceberg orphan file deletion optimizer.
Fields
-
orphanFileRetentionPeriodInDays
– Number (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
– UTF-8 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.
CompactionMetrics structure
A structure that contains compaction metrics for the optimizer run.
Fields
-
IcebergMetrics
– An IcebergCompactionMetrics object.A structure containing the Iceberg compaction metrics for the optimizer run.
RetentionMetrics structure
A structure that contains retention metrics for the optimizer run.
Fields
-
IcebergMetrics
– An IcebergRetentionMetrics object.A structure containing the Iceberg retention metrics for the optimizer run.
OrphanFileDeletionMetrics structure
A structure that contains orphan file deletion metrics for the optimizer run.
Fields
-
IcebergMetrics
– An IcebergOrphanFileDeletionMetrics object.A structure containing the Iceberg orphan file deletion metrics for the optimizer run.
IcebergCompactionMetrics structure
Compaction metrics for Iceberg for the optimizer run.
Fields
-
NumberOfDpus
– Number (Integer).The number of DPU hours consumed by the job.
-
JobDurationInHour
– Number (double).The duration of the job in hours.
IcebergRetentionMetrics structure
Snapshot retention metrics for Iceberg for the optimizer run.
Fields
-
NumberOfDpus
– Number (Integer).The number of DPU hours consumed by the job.
-
JobDurationInHour
– Number (double).The duration of the job in hours.
IcebergOrphanFileDeletionMetrics structure
Orphan file deletion metrics for Iceberg for the optimizer run.
Fields
-
NumberOfDpus
– Number (Integer).The number of DPU hours consumed by the job.
-
JobDurationInHour
– Number (double).The duration of the job in hours.
RunMetrics structure
Metrics for the optimizer run.
This structure is deprecated. See the individual metric members for compaction, retention, and orphan file deletion.
Fields
-
NumberOfBytesCompacted
– UTF-8 string.The number of bytes removed by the compaction job run.
-
NumberOfFilesCompacted
– UTF-8 string.The number of files removed by the compaction job run.
-
NumberOfDpus
– UTF-8 string.The number of DPU hours consumed by the job.
-
JobDurationInHour
– UTF-8 string.The duration of the job in hours.
Operations
BatchGetTableOptimizer action (Python: batch_get_table_optimizer)
ListTableOptimizerRuns action (Python: list_table_optimizer_runs)
CreateTableOptimizer action (Python: create_table_optimizer)
DeleteTableOptimizer action (Python: delete_table_optimizer)
UpdateTableOptimizer action (Python: update_table_optimizer)
GetTableOptimizer action (Python: get_table_optimizer)
Returns the configuration of all optimizers associated with a specified table.
Request
-
CatalogId
– Required: Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
DatabaseName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the database in the catalog in which the table resides.
-
TableName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the table.
-
Type
– Required: UTF-8 string (valid values:compaction="COMPACTION"
|retention="RETENTION"
|orphan_file_deletion="ORPHAN_FILE_DELETION"
).The type of table optimizer.
Response
-
CatalogId
– Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
DatabaseName
– UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the database in the catalog in which the table resides.
-
TableName
– UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the table.
-
TableOptimizer
– A TableOptimizer object.The optimizer associated with the specified table.
Errors
EntityNotFoundException
InvalidInputException
AccessDeniedException
InternalServiceException
ThrottlingException
BatchGetTableOptimizer action (Python: batch_get_table_optimizer)
Returns the configuration for the specified table optimizers.
Request
-
Entries
– Required: An array of BatchGetTableOptimizerEntry objects.A list of
BatchGetTableOptimizerEntry
objects specifying the table optimizers to retrieve.
Response
-
TableOptimizers
– An array of BatchTableOptimizer objects.A list of
BatchTableOptimizer
objects. -
Failures
– An array of BatchGetTableOptimizerError objects.A list of errors from the operation.
Errors
EntityNotFoundException
InvalidInputException
AccessDeniedException
InternalServiceException
ThrottlingException
ListTableOptimizerRuns action (Python: list_table_optimizer_runs)
Lists the history of previous optimizer runs for a specific table.
Request
-
CatalogId
– Required: Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
DatabaseName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the database in the catalog in which the table resides.
-
TableName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the table.
-
Type
– Required: UTF-8 string (valid values:compaction="COMPACTION"
|retention="RETENTION"
|orphan_file_deletion="ORPHAN_FILE_DELETION"
).The type of table optimizer.
-
MaxResults
– Number (integer).The maximum number of optimizer runs to return on each call.
-
NextToken
– UTF-8 string.A continuation token, if this is a continuation call.
Response
-
CatalogId
– Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
DatabaseName
– UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the database in the catalog in which the table resides.
-
TableName
– UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the table.
-
NextToken
– UTF-8 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
– An array of TableOptimizerRun objects.A list of the optimizer runs associated with a table.
Errors
EntityNotFoundException
AccessDeniedException
InvalidInputException
ValidationException
InternalServiceException
ThrottlingException
CreateTableOptimizer action (Python: create_table_optimizer)
Creates a new table optimizer for a specific function.
Request
-
CatalogId
– Required: Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
DatabaseName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the database in the catalog in which the table resides.
-
TableName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the table.
-
Type
– Required: UTF-8 string (valid values:compaction="COMPACTION"
|retention="RETENTION"
|orphan_file_deletion="ORPHAN_FILE_DELETION"
).The type of table optimizer.
-
TableOptimizerConfiguration
– Required: A TableOptimizerConfiguration object.A
TableOptimizerConfiguration
object representing the configuration of a table optimizer.
Response
No Response parameters.
Errors
EntityNotFoundException
ValidationException
InvalidInputException
AccessDeniedException
AlreadyExistsException
InternalServiceException
ThrottlingException
DeleteTableOptimizer action (Python: delete_table_optimizer)
Deletes an optimizer and all associated metadata for a table. The optimization will no longer be performed on the table.
Request
-
CatalogId
– Required: Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
DatabaseName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the database in the catalog in which the table resides.
-
TableName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the table.
-
Type
– Required: UTF-8 string (valid values:compaction="COMPACTION"
|retention="RETENTION"
|orphan_file_deletion="ORPHAN_FILE_DELETION"
).The type of table optimizer.
Response
No Response parameters.
Errors
EntityNotFoundException
InvalidInputException
AccessDeniedException
InternalServiceException
ThrottlingException
UpdateTableOptimizer action (Python: update_table_optimizer)
Updates the configuration for an existing table optimizer.
Request
-
CatalogId
– Required: Catalog id string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The Catalog ID of the table.
-
DatabaseName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the database in the catalog in which the table resides.
-
TableName
– Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.The name of the table.
-
Type
– Required: UTF-8 string (valid values:compaction="COMPACTION"
|retention="RETENTION"
|orphan_file_deletion="ORPHAN_FILE_DELETION"
).The type of table optimizer.
-
TableOptimizerConfiguration
– Required: A TableOptimizerConfiguration object.A
TableOptimizerConfiguration
object representing the configuration of a table optimizer.
Response
No Response parameters.
Errors
EntityNotFoundException
InvalidInputException
AccessDeniedException
ValidationException
InternalServiceException
ThrottlingException
ConcurrentModificationException