table_optimizers
Creates, updates, deletes, gets or lists a table_optimizers resource.
Overview
| Name | table_optimizers |
| Type | Resource |
| Id | aws.glue.table_optimizers |
Fields
The following fields are returned by SELECT queries:
- get_table_optimizer
- batch_get_table_optimizer
| Name | Datatype | Description |
|---|---|---|
catalog_id | string | The Catalog ID of the table. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
database_name | string | The name of the database in the catalog in which the table resides. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
table_name | string | The name of the table. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
table_optimizer | object | The optimizer associated with the specified table. |
| Name | Datatype | Description |
|---|---|---|
failures | array | A list of errors from the operation. |
table_optimizers | array | A list of BatchTableOptimizer objects. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_table_optimizer | select | region | Returns the configuration of all optimizers associated with a specified table. | |
batch_get_table_optimizer | select | region | Returns the configuration for the specified table optimizers. | |
create_table_optimizer | insert | region, CatalogId, DatabaseName, TableName, Type, TableOptimizerConfiguration | Creates a new table optimizer for a specific function. | |
update_table_optimizer | update | region, CatalogId, DatabaseName, TableName, Type, TableOptimizerConfiguration | Updates the configuration for an existing table optimizer. | |
delete_table_optimizer | delete | region | Deletes an optimizer and all associated metadata for a table. The optimization will no longer be performed on the table. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_table_optimizer
- batch_get_table_optimizer
Returns the configuration of all optimizers associated with a specified table.
SELECT
catalog_id,
database_name,
table_name,
table_optimizer
FROM aws.glue.table_optimizers
WHERE region = '{{ region }}' -- required
;
Returns the configuration for the specified table optimizers.
SELECT
failures,
table_optimizers
FROM aws.glue.table_optimizers
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_table_optimizer
- Manifest
Creates a new table optimizer for a specific function.
INSERT INTO aws.glue.table_optimizers (
CatalogId,
DatabaseName,
TableName,
Type,
TableOptimizerConfiguration,
region
)
SELECT
'{{ CatalogId }}' /* required */,
'{{ DatabaseName }}' /* required */,
'{{ TableName }}' /* required */,
'{{ Type }}' /* required */,
'{{ TableOptimizerConfiguration }}' /* required */,
'{{ region }}'
;
# Description fields are for documentation purposes
- name: table_optimizers
props:
- name: region
value: "{{ region }}"
description: Required parameter for the table_optimizers resource.
- name: CatalogId
value: "{{ CatalogId }}"
description: |
The Catalog ID of the table.
- name: DatabaseName
value: "{{ DatabaseName }}"
description: |
The name of the database in the catalog in which the table resides.
- name: TableName
value: "{{ TableName }}"
description: |
The name of the table.
- name: Type
value: "{{ Type }}"
description: |
The type of table optimizer.
valid_values: ['compaction', 'retention', 'orphan_file_deletion']
- name: TableOptimizerConfiguration
description: |
A TableOptimizerConfiguration object representing the configuration of a table optimizer.
value:
roleArn: "{{ roleArn }}"
enabled: {{ enabled }}
vpcConfiguration:
glueConnectionName: "{{ glueConnectionName }}"
compactionConfiguration:
icebergConfiguration:
strategy: "{{ strategy }}"
minInputFiles: {{ minInputFiles }}
deleteFileThreshold: {{ deleteFileThreshold }}
retentionConfiguration:
icebergConfiguration:
snapshotRetentionPeriodInDays: {{ snapshotRetentionPeriodInDays }}
numberOfSnapshotsToRetain: {{ numberOfSnapshotsToRetain }}
cleanExpiredFiles: {{ cleanExpiredFiles }}
runRateInHours: {{ runRateInHours }}
orphanFileDeletionConfiguration:
icebergConfiguration:
orphanFileRetentionPeriodInDays: {{ orphanFileRetentionPeriodInDays }}
location: "{{ location }}"
runRateInHours: {{ runRateInHours }}
UPDATE examples
- update_table_optimizer
Updates the configuration for an existing table optimizer.
UPDATE aws.glue.table_optimizers
SET
CatalogId = '{{ CatalogId }}',
DatabaseName = '{{ DatabaseName }}',
TableName = '{{ TableName }}',
Type = '{{ Type }}',
TableOptimizerConfiguration = '{{ TableOptimizerConfiguration }}'
WHERE
region = '{{ region }}' --required
AND CatalogId = '{{ CatalogId }}' --required
AND DatabaseName = '{{ DatabaseName }}' --required
AND TableName = '{{ TableName }}' --required
AND Type = '{{ Type }}' --required
AND TableOptimizerConfiguration = '{{ TableOptimizerConfiguration }}' --required;
DELETE examples
- delete_table_optimizer
Deletes an optimizer and all associated metadata for a table. The optimization will no longer be performed on the table.
DELETE FROM aws.glue.table_optimizers
WHERE region = '{{ region }}' --required
;