Skip to content

aws.glue.get_column_statistics_for_table

Example SQL Queries

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

Description

Retrieves table statistics of columns.

The Identity and Access Management (IAM) permission required for this operation is GetTable.

Table Definition

Column NameColumn Data Type
column_names Required Input Column

A list of the column names.

VARCHAR[]
Show child fields
column_names[]
database_name Required Input Column

The name of the catalog database where the partitions reside.

VARCHAR
table_name Required Input Column

The name of the partitions' table.

VARCHAR
catalog_id Input Column

The ID of the Data Catalog where the partitions in question reside. If none is supplied, the Amazon Web Services account ID is used by default.

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
column_statistics_list

List of ColumnStatistics.

STRUCT(
"column_name" VARCHAR,
"column_type" VARCHAR,
"analyzed_time" TIMESTAMP_S,
"statistics_data" STRUCT(
"type" VARCHAR,
"boolean_column_statistics_data" STRUCT(
"number_of_trues" BIGINT,
"number_of_falses" BIGINT,
"number_of_nulls" BIGINT
),
"date_column_statistics_data" STRUCT(
"minimum_value" TIMESTAMP_S,
"maximum_value" TIMESTAMP_S,
"number_of_nulls" BIGINT,
"number_of_distinct_values" BIGINT
),
"decimal_column_statistics_data" STRUCT(
"minimum_value" STRUCT(
"unscaled_value" BLOB,
"scale" BIGINT
),
"maximum_value" STRUCT(
"unscaled_value" BLOB,
"scale" BIGINT
),
"number_of_nulls" BIGINT,
"number_of_distinct_values" BIGINT
),
"double_column_statistics_data" STRUCT(
"minimum_value" DOUBLE,
"maximum_value" DOUBLE,
"number_of_nulls" BIGINT,
"number_of_distinct_values" BIGINT
),
"long_column_statistics_data" STRUCT(
"minimum_value" BIGINT,
"maximum_value" BIGINT,
"number_of_nulls" BIGINT,
"number_of_distinct_values" BIGINT
),
"string_column_statistics_data" STRUCT(
"maximum_length" BIGINT,
"average_length" DOUBLE,
"number_of_nulls" BIGINT,
"number_of_distinct_values" BIGINT
),
"binary_column_statistics_data" STRUCT(
"maximum_length" BIGINT,
"average_length" DOUBLE,
"number_of_nulls" BIGINT
)
)
)[]
Show child fields
column_statistics_list[]
Show child fields
column_statistics_list[].analyzed_time

The timestamp of when column statistics were generated.

column_statistics_list[].column_name

Name of column which statistics belong to.

column_statistics_list[].column_type

The data type of the column.

column_statistics_list[].statistics_data

A ColumnStatisticData object that contains the statistics data values.

Show child fields
column_statistics_list[].statistics_data.binary_column_statistics_data

Binary column statistics data.

Show child fields
column_statistics_list[].statistics_data.binary_column_statistics_data.average_length

The average bit sequence length in the column.

column_statistics_list[].statistics_data.binary_column_statistics_data.maximum_length

The size of the longest bit sequence in the column.

column_statistics_list[].statistics_data.binary_column_statistics_data.number_of_nulls

The number of null values in the column.

column_statistics_list[].statistics_data.boolean_column_statistics_data

Boolean column statistics data.

Show child fields
column_statistics_list[].statistics_data.boolean_column_statistics_data.number_of_falses

The number of false values in the column.

column_statistics_list[].statistics_data.boolean_column_statistics_data.number_of_nulls

The number of null values in the column.

column_statistics_list[].statistics_data.boolean_column_statistics_data.number_of_trues

The number of true values in the column.

column_statistics_list[].statistics_data.date_column_statistics_data

Date column statistics data.

Show child fields
column_statistics_list[].statistics_data.date_column_statistics_data.maximum_value

The highest value in the column.

column_statistics_list[].statistics_data.date_column_statistics_data.minimum_value

The lowest value in the column.

column_statistics_list[].statistics_data.date_column_statistics_data.number_of_distinct_values

The number of distinct values in a column.

column_statistics_list[].statistics_data.date_column_statistics_data.number_of_nulls

The number of null values in the column.

column_statistics_list[].statistics_data.decimal_column_statistics_data

Decimal column statistics data. UnscaledValues within are Base64-encoded binary objects storing big-endian, two's complement representations of the decimal's unscaled value.

Show child fields
column_statistics_list[].statistics_data.decimal_column_statistics_data.maximum_value

The highest value in the column.

Show child fields
column_statistics_list[].statistics_data.decimal_column_statistics_data.maximum_value.scale

The scale that determines where the decimal point falls in the unscaled value.

column_statistics_list[].statistics_data.decimal_column_statistics_data.maximum_value.unscaled_value

The unscaled numeric value.

column_statistics_list[].statistics_data.decimal_column_statistics_data.minimum_value

The lowest value in the column.

Show child fields
column_statistics_list[].statistics_data.decimal_column_statistics_data.minimum_value.scale

The scale that determines where the decimal point falls in the unscaled value.

column_statistics_list[].statistics_data.decimal_column_statistics_data.minimum_value.unscaled_value

The unscaled numeric value.

column_statistics_list[].statistics_data.decimal_column_statistics_data.number_of_distinct_values

The number of distinct values in a column.

column_statistics_list[].statistics_data.decimal_column_statistics_data.number_of_nulls

The number of null values in the column.

column_statistics_list[].statistics_data.double_column_statistics_data

Double column statistics data.

Show child fields
column_statistics_list[].statistics_data.double_column_statistics_data.maximum_value

The highest value in the column.

column_statistics_list[].statistics_data.double_column_statistics_data.minimum_value

The lowest value in the column.

column_statistics_list[].statistics_data.double_column_statistics_data.number_of_distinct_values

The number of distinct values in a column.

column_statistics_list[].statistics_data.double_column_statistics_data.number_of_nulls

The number of null values in the column.

column_statistics_list[].statistics_data.long_column_statistics_data

Long column statistics data.

Show child fields
column_statistics_list[].statistics_data.long_column_statistics_data.maximum_value

The highest value in the column.

column_statistics_list[].statistics_data.long_column_statistics_data.minimum_value

The lowest value in the column.

column_statistics_list[].statistics_data.long_column_statistics_data.number_of_distinct_values

The number of distinct values in a column.

column_statistics_list[].statistics_data.long_column_statistics_data.number_of_nulls

The number of null values in the column.

column_statistics_list[].statistics_data.string_column_statistics_data

String column statistics data.

Show child fields
column_statistics_list[].statistics_data.string_column_statistics_data.average_length

The average string length in the column.

column_statistics_list[].statistics_data.string_column_statistics_data.maximum_length

The size of the longest string in the column.

column_statistics_list[].statistics_data.string_column_statistics_data.number_of_distinct_values

The number of distinct values in a column.

column_statistics_list[].statistics_data.string_column_statistics_data.number_of_nulls

The number of null values in the column.

column_statistics_list[].statistics_data.type

The type of column statistics data.

errors

List of ColumnStatistics that failed to be retrieved.

STRUCT(
"column_name" VARCHAR,
"error" STRUCT(
"error_code" VARCHAR,
"error_message" VARCHAR
)
)[]
Show child fields
errors[]
Show child fields
errors[].column_name

The name of the column that failed.

errors[].error

An error message with the reason for the failure of an operation.

Show child fields
errors[].error.error_code

The code associated with this error.

errors[].error.error_message

A message describing the error.