Table optimizer API - Amazon Glue
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

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").

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

  • 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 1 or more than 512 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.

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.

  • error – UTF-8 string.

    An error that occured during the optimizer run.

RunMetrics structure

Metrics for the optimizer run.

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.

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").

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

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").

    The type of table optimizer.

Operations

GetTableOptimizer action (Python: get_table_optimizer)

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

Request
  • CatalogIdRequired: 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.

  • DatabaseNameRequired: 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.

  • TableNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the table.

  • TypeRequired: UTF-8 string (valid values: compaction="COMPACTION").

    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
  • EntriesRequired: An array of BatchGetTableOptimizerEntry objects.

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

Response
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
  • CatalogIdRequired: 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.

  • DatabaseNameRequired: 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.

  • TableNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the table.

  • TypeRequired: UTF-8 string (valid values: compaction="COMPACTION").

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

  • 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. compaction is the only currently supported optimizer type.

Request
  • CatalogIdRequired: 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.

  • DatabaseNameRequired: 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.

  • TableNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the table.

  • TypeRequired: UTF-8 string (valid values: compaction="COMPACTION").

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

  • TableOptimizerConfigurationRequired: 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
  • CatalogIdRequired: 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.

  • DatabaseNameRequired: 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.

  • TableNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the table.

  • TypeRequired: UTF-8 string (valid values: compaction="COMPACTION").

    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
  • CatalogIdRequired: 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.

  • DatabaseNameRequired: 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.

  • TableNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the table.

  • TypeRequired: UTF-8 string (valid values: compaction="COMPACTION").

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

  • TableOptimizerConfigurationRequired: A TableOptimizerConfiguration object.

    A TableOptimizerConfiguration object representing the configuration of a table optimizer.

Response
  • No Response parameters.

Errors
  • EntityNotFoundException

  • InvalidInputException

  • AccessDeniedException

  • ValidationException

  • InternalServiceException

  • ThrottlingException