Skip to content

aws.glue.get_partitions

Example SQL Queries

SELECT * FROM
aws.glue.get_partitions
WHERE
"database_name" = 'VALUE'
AND "table_name" = 'VALUE';

Description

Retrieves information about the partitions in a table.

Table Definition

Column NameColumn Data Type
database_name Required Input Column

The name of the catalog database in which to create the partition.

VARCHAR
table_name Required Input Column

The name of the database table in which to create the partition.

VARCHAR
catalog_id Input Column

The ID of the Data Catalog in which the partition resides.

VARCHAR
exclude_column_schema Input Column

When true, specifies not returning the partition column schema. Useful when you are interested only in other partition attributes such as partition values or location. This approach avoids the problem of a large response by not returning duplicate data.

BOOLEAN
expression Input Column

An expression that filters the partitions to be returned.

The expression uses SQL syntax similar to the SQL WHERE filter clause. The SQL statement parser JSQLParser parses the expression.

Operators: The following are the operators that you can use in the Expression API call:

=

Checks whether the values of the two operands are equal; if yes, then the condition becomes true.

Example: Assume 'variable a' holds 10 and 'variable b' holds 20.

(a = b) is not true.

< >

Checks whether the values of two operands are equal; if the values are not equal, then the condition becomes true.

Example: (a < > b) is true.

>

Checks whether the value of the left operand is greater than the value of the right operand; if yes, then the condition becomes true.

Example: (a > b) is not true.

<

Checks whether the value of the left operand is less than the value of the right operand; if yes, then the condition becomes true.

Example: (a < b) is true.

>=

Checks whether the value of the left operand is greater than or equal to the value of the right operand; if yes, then the condition becomes true.

Example: (a >= b) is not true.

<=

Checks whether the value of the left operand is less than or equal to the value of the right operand; if yes, then the condition becomes true.

Example: (a <= b) is true.

AND, OR, IN, BETWEEN, LIKE, NOT, IS NULL

Logical operators.

Supported Partition Key Types: The following are the supported partition keys.

  • string

  • date

  • timestamp

  • int

  • bigint

  • long

  • tinyint

  • smallint

  • decimal

If an type is encountered that is not valid, an exception is thrown.

The following list shows the valid operators on each type. When you define a crawler, the partitionKey type is created as a STRING, to be compatible with the catalog partitions.

Sample API Call:

VARCHAR
query_as_of_time Input Column

The time as of when to read the partition contents. If not set, the most recent transaction commit time will be used. Cannot be specified along with TransactionId.

TIMESTAMP_S
segment Input Column

The segment of the table's partitions to scan in this request.

STRUCT(
"segment_number" BIGINT,
"total_segments" BIGINT
)
Show child fields
segment.segment_number

The zero-based index number of the segment. For example, if the total number of segments is 4, SegmentNumber values range from 0 through 3.

segment.total_segments

The total number of segments.

transaction_id Input Column

The transaction ID at which to read the partition contents.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
creation_time

The time at which the partition was created.

TIMESTAMP_S
last_access_time

The last time at which the partition was accessed.

TIMESTAMP_S
last_analyzed_time

The last time at which column statistics were computed for this partition.

TIMESTAMP_S
parameters

These key-value pairs define partition parameters.

MAP(VARCHAR, VARCHAR)
storage_descriptor

Provides information about the physical location where the partition is stored.

STRUCT(
"columns" STRUCT(
"name" VARCHAR,
"type" VARCHAR,
"comment" VARCHAR,
"parameters" MAP(VARCHAR, VARCHAR)
)[],
"location" VARCHAR,
"additional_locations" VARCHAR[],
"input_format" VARCHAR,
"output_format" VARCHAR,
"compressed" BOOLEAN,
"number_of_buckets" BIGINT,
"serde_info" STRUCT(
"name" VARCHAR,
"serialization_library" VARCHAR,
"parameters" MAP(VARCHAR, VARCHAR)
),
"bucket_columns" VARCHAR[],
"sort_columns" STRUCT(
"column" VARCHAR,
"sort_order" BIGINT
)[],
"parameters" MAP(VARCHAR, VARCHAR),
"skewed_info" STRUCT(
"skewed_column_names" VARCHAR[],
"skewed_column_values" VARCHAR[],
"skewed_column_value_location_maps" MAP(VARCHAR, VARCHAR)
),
"stored_as_sub_directories" BOOLEAN,
"schema_reference" STRUCT(
"schema_id" STRUCT(
"schema_arn" VARCHAR,
"schema_name" VARCHAR,
"registry_name" VARCHAR
),
"schema_version_id" VARCHAR,
"schema_version_number" BIGINT
)
)
Show child fields
storage_descriptor.additional_locations[]
storage_descriptor.bucket_columns[]
storage_descriptor.columns[]
Show child fields
storage_descriptor.columns[].comment

A free-form text comment.

storage_descriptor.columns[].name

The name of the Column.

storage_descriptor.columns[].parameters

These key-value pairs define properties associated with the column.

storage_descriptor.columns[].type

The data type of the Column.

storage_descriptor.compressed

True if the data in the table is compressed, or False if not.

storage_descriptor.input_format

The input format: SequenceFileInputFormat (binary), or TextInputFormat, or a custom format.

storage_descriptor.location

The physical location of the table. By default, this takes the form of the warehouse location, followed by the database location in the warehouse, followed by the table name.

storage_descriptor.number_of_buckets

Must be specified if the table contains any dimension columns.

storage_descriptor.output_format

The output format: SequenceFileOutputFormat (binary), or IgnoreKeyTextOutputFormat, or a custom format.

storage_descriptor.parameters

The user-supplied properties in key-value form.

storage_descriptor.schema_reference

An object that references a schema stored in the Glue Schema Registry.

When creating a table, you can pass an empty list of columns for the schema, and instead use a schema reference.

Show child fields
storage_descriptor.schema_reference.schema_id

A structure that contains schema identity fields. Either this or the SchemaVersionId has to be provided.

Show child fields
storage_descriptor.schema_reference.schema_id.registry_name

The name of the schema registry that contains the schema.

storage_descriptor.schema_reference.schema_id.schema_arn

The Amazon Resource Name (ARN) of the schema. One of SchemaArn or SchemaName has to be provided.

storage_descriptor.schema_reference.schema_id.schema_name

The name of the schema. One of SchemaArn or SchemaName has to be provided.

storage_descriptor.schema_reference.schema_version_id

The unique ID assigned to a version of the schema. Either this or the SchemaId has to be provided.

storage_descriptor.schema_reference.schema_version_number

The version number of the schema.

storage_descriptor.serde_info

The serialization/deserialization (SerDe) information.

Show child fields
storage_descriptor.serde_info.name

Name of the SerDe.

storage_descriptor.serde_info.parameters

These key-value pairs define initialization parameters for the SerDe.

storage_descriptor.serde_info.serialization_library

Usually the class that implements the SerDe. An example is org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe.

storage_descriptor.skewed_info

The information about values that appear frequently in a column (skewed values).

Show child fields
storage_descriptor.skewed_info.skewed_column_names[]
storage_descriptor.skewed_info.skewed_column_value_location_maps

A mapping of skewed values to the columns that contain them.

storage_descriptor.skewed_info.skewed_column_values[]
storage_descriptor.sort_columns[]
Show child fields
storage_descriptor.sort_columns[].column

The name of the column.

storage_descriptor.sort_columns[].sort_order

Indicates that the column is sorted in ascending order (== 1), or in descending order (==0).

storage_descriptor.stored_as_sub_directories

True if the table data is stored in subdirectories, or False if not.

values

The values of the partition.

VARCHAR[]
Show child fields
values[]