partitions
Creates, updates, deletes, gets or lists a partitions resource.
Overview
| Name | partitions |
| Type | Resource |
| Id | aws.glue.partitions |
Fields
The following fields are returned by SELECT queries:
- batch_get_partition
- get_partition
- get_partitions
| Name | Datatype | Description |
|---|---|---|
partitions | array | A list of the requested partitions. |
unprocessed_keys | array | A list of the partition values in the request for which partitions were not returned. |
| Name | Datatype | Description |
|---|---|---|
catalog_id | string | The ID of the Data Catalog in which the partition resides. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
creation_time | string (date-time) | The time at which the partition was created. |
database_name | string | The name of the catalog database in which to create the partition. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
last_access_time | string (date-time) | The last time at which the partition was accessed. |
last_analyzed_time | string (date-time) | The last time at which column statistics were computed for this partition. |
parameters | object | These key-value pairs define partition parameters. |
storage_descriptor | object | Provides information about the physical location where the partition is stored. |
table_name | string | The name of the database table in which to create the partition. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
values | array | The values of the partition. |
| Name | Datatype | Description |
|---|---|---|
catalog_id | string | The ID of the Data Catalog in which the partition resides. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
creation_time | string (date-time) | The time at which the partition was created. |
database_name | string | The name of the catalog database in which to create the partition. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
last_access_time | string (date-time) | The last time at which the partition was accessed. |
last_analyzed_time | string (date-time) | The last time at which column statistics were computed for this partition. |
parameters | object | These key-value pairs define partition parameters. |
storage_descriptor | object | Provides information about the physical location where the partition is stored. |
table_name | string | The name of the database table in which to create the partition. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code>) |
values | array | The values of the partition. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_partition | select | region | Retrieves partitions in a batch request. | |
get_partition | select | region | Retrieves information about a specified partition. | |
get_partitions | select | region | Retrieves information about the partitions in a table. | |
create_partition | insert | region, DatabaseName, TableName, PartitionInput | Creates a new partition. | |
update_partition | update | region, DatabaseName, TableName, PartitionValueList, PartitionInput | Updates a partition. | |
delete_partition | delete | region | Deletes a specified partition. |
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
- batch_get_partition
- get_partition
- get_partitions
Retrieves partitions in a batch request.
SELECT
partitions,
unprocessed_keys
FROM aws.glue.partitions
WHERE region = '{{ region }}' -- required
;
Retrieves information about a specified partition.
SELECT
catalog_id,
creation_time,
database_name,
last_access_time,
last_analyzed_time,
parameters,
storage_descriptor,
table_name,
values
FROM aws.glue.partitions
WHERE region = '{{ region }}' -- required
;
Retrieves information about the partitions in a table.
SELECT
catalog_id,
creation_time,
database_name,
last_access_time,
last_analyzed_time,
parameters,
storage_descriptor,
table_name,
values
FROM aws.glue.partitions
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_partition
- Manifest
Creates a new partition.
INSERT INTO aws.glue.partitions (
CatalogId,
DatabaseName,
TableName,
PartitionInput,
region
)
SELECT
'{{ CatalogId }}',
'{{ DatabaseName }}' /* required */,
'{{ TableName }}' /* required */,
'{{ PartitionInput }}' /* required */,
'{{ region }}'
;
# Description fields are for documentation purposes
- name: partitions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the partitions resource.
- name: CatalogId
value: "{{ CatalogId }}"
description: |
The Amazon Web Services account ID of the catalog in which the partition is to be created.
- name: DatabaseName
value: "{{ DatabaseName }}"
description: |
The name of the metadata database in which the partition is to be created.
- name: TableName
value: "{{ TableName }}"
description: |
The name of the metadata table in which the partition is to be created.
- name: PartitionInput
description: |
The structure used to create and update a partition.
value:
Values:
- "{{ Values }}"
LastAccessTime: "{{ LastAccessTime }}"
StorageDescriptor:
Columns:
- Name: "{{ Name }}"
Type: "{{ Type }}"
Comment: "{{ Comment }}"
Parameters: "{{ Parameters }}"
Location: "{{ Location }}"
AdditionalLocations:
- "{{ AdditionalLocations }}"
InputFormat: "{{ InputFormat }}"
OutputFormat: "{{ OutputFormat }}"
Compressed: {{ Compressed }}
NumberOfBuckets: {{ NumberOfBuckets }}
SerdeInfo:
Name: "{{ Name }}"
SerializationLibrary: "{{ SerializationLibrary }}"
Parameters: "{{ Parameters }}"
BucketColumns:
- "{{ BucketColumns }}"
SortColumns:
- Column: "{{ Column }}"
SortOrder: {{ SortOrder }}
Parameters: "{{ Parameters }}"
SkewedInfo:
SkewedColumnNames:
- "{{ SkewedColumnNames }}"
SkewedColumnValues:
- "{{ SkewedColumnValues }}"
SkewedColumnValueLocationMaps: "{{ SkewedColumnValueLocationMaps }}"
StoredAsSubDirectories: {{ StoredAsSubDirectories }}
SchemaReference:
SchemaId:
SchemaArn: "{{ SchemaArn }}"
SchemaName: "{{ SchemaName }}"
RegistryName: "{{ RegistryName }}"
SchemaVersionId: "{{ SchemaVersionId }}"
SchemaVersionNumber: {{ SchemaVersionNumber }}
Parameters: "{{ Parameters }}"
LastAnalyzedTime: "{{ LastAnalyzedTime }}"
UPDATE examples
- update_partition
Updates a partition.
UPDATE aws.glue.partitions
SET
CatalogId = '{{ CatalogId }}',
DatabaseName = '{{ DatabaseName }}',
TableName = '{{ TableName }}',
PartitionValueList = '{{ PartitionValueList }}',
PartitionInput = '{{ PartitionInput }}'
WHERE
region = '{{ region }}' --required
AND DatabaseName = '{{ DatabaseName }}' --required
AND TableName = '{{ TableName }}' --required
AND PartitionValueList = '{{ PartitionValueList }}' --required
AND PartitionInput = '{{ PartitionInput }}' --required;
DELETE examples
- delete_partition
Deletes a specified partition.
DELETE FROM aws.glue.partitions
WHERE region = '{{ region }}' --required
;