View a markdown version of this page

Amazon S3 system tables schema and example queries - Amazon Simple Storage Service

Amazon S3 system tables schema and example queries

Amazon S3 has the following system tables. This page lists the columns for the tables in the aws-catalog table bucket. For the other tables, see the linked page.

Table Table bucket / namespace Columns
buckets aws-catalog / s3 s3.buckets (below)
buckets aws-catalog / s3tables s3tables.buckets (below)
namespaces aws-catalog / s3tables s3tables.namespaces (below)
tables aws-catalog / s3tables s3tables.tables (below)
table_columns aws-catalog / s3tables s3tables.table_columns (below)
buckets aws-catalog / s3vectors s3vectors.buckets (below)
indexes aws-catalog / s3vectors s3vectors.indexes (below)
journal aws-s3 / b_<bucket-name> S3 Metadata journal tables schema
inventory aws-s3 / b_<bucket-name> S3 Metadata live inventory tables schema
annotation aws-s3 / b_<bucket-name> S3 Metadata annotation table schema
default_storage_metrics aws-s3 / lens_<config-id>_exp[_<hash>] Understanding S3 Storage Lens table schemas
default_activity_metrics aws-s3 / lens_<config-id>_exp[_<hash>] Understanding S3 Storage Lens table schemas
expanded_prefixes_storage_metrics aws-s3 / lens_<config-id>_exp[_<hash>] Understanding S3 Storage Lens table schemas
expanded_prefixes_activity_metrics aws-s3 / lens_<config-id>_exp[_<hash>] Understanding S3 Storage Lens table schemas
bucket_property_metrics aws-s3 / lens_<config-id>_exp[_<hash>] Understanding S3 Storage Lens table schemas
amazon_s3__server_access aws-cloudwatch / logs Querying access logs in S3 Tables

Table schemas

s3.buckets

Full name: "s3tablescatalog/aws-catalog"."s3"."buckets". Partitioned by bucket(32, id).

Contains your general purpose buckets (asset type amazon.s3::Bucket).

Column Type Required Description
id string Yes Unique identifier of the asset.
ingestion_time timestamptz Yes Time this asset record was ingested into the system table, in UTC.
update_time timestamptz No Time the asset was last updated in the AWS Glue Data Catalog, in UTC.
schema_version string Yes Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped.
created_time timestamptz No Time the resource was created, in UTC.
name string No The user-provided business name for the asset.
description string No The user-provided business description for the asset.
resource_name string Yes The resource's technical name.
resource_description string No The resource's technical description.
bucket_namespace_enum string No The naming namespace of the bucket. Valid values: Global, AccountRegional.

s3tables.buckets

Full name: "s3tablescatalog/aws-catalog"."s3tables"."buckets". Partitioned by bucket(32, id).

Contains your table buckets, both customer managed and AWS managed (amazon.s3tables::Bucket).

Column Type Required Description
id string Yes Unique identifier of the asset.
ingestion_time timestamptz Yes Time this asset record was ingested into the system table, in UTC.
update_time timestamptz No Time the asset was last updated in the AWS Glue Data Catalog, in UTC.
schema_version string Yes Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped.
created_time timestamptz No Time the resource was created, in UTC.
name string No The user-provided business name for the asset.
description string No The user-provided business description for the asset.
resource_name string Yes The resource's technical name.
resource_description string No The resource's technical description.
s3_table_bucket_encryption_type_enum string No The default server-side encryption type for new tables in the table bucket. Valid values: AES256, aws:kms.
s3_table_bucket_storage_class_enum string No The default S3 storage class for new tables in the table bucket. Valid values: STANDARD, INTELLIGENT_TIERING.
s3_table_bucket_id string Yes The unique identifier of the table bucket.
s3_table_bucket_type_enum string No Indicates whether the table bucket is created and managed by the customer or by AWS (for example, the aws-s3 table bucket that holds S3 Metadata tables). Valid values: customer, aws.
kms_key_id string No The identifier of the AWS Key Management Service (AWS KMS) key that encrypts the resource at rest, as the source service reports it: a key ID, key ARN, alias name, or alias ARN.

s3tables.namespaces

Full name: "s3tablescatalog/aws-catalog"."s3tables"."namespaces". Partitioned by bucket(32, id).

Contains the namespaces in your table buckets (amazon.s3tables::Namespace).

Column Type Required Description
id string Yes Unique identifier of the asset.
ingestion_time timestamptz Yes Time this asset record was ingested into the system table, in UTC.
update_time timestamptz No Time the asset was last updated in the AWS Glue Data Catalog, in UTC.
schema_version string Yes Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped.
created_time timestamptz No Time the resource was created, in UTC.
name string No The user-provided business name for the asset.
description string No The user-provided business description for the asset.
resource_name string Yes The resource's technical name.
resource_description string No The resource's technical description.
s3_table_namespace_id string Yes The unique identifier of the namespace. Unlike the name, it differs between a deleted namespace and one created later with the same name.
belongs_to string No Fully qualified identifier of the container asset this asset is a member of.

s3tables.tables

Full name: "s3tablescatalog/aws-catalog"."s3tables"."tables". Partitioned by bucket(32, id).

Contains the tables in your table buckets, including S3 Metadata tables and other tables that AWS manages (amazon.s3tables::Table).

Column Type Required Description
id string Yes Unique identifier of the asset.
ingestion_time timestamptz Yes Time this asset record was ingested into the system table, in UTC.
update_time timestamptz No Time the asset was last updated in the AWS Glue Data Catalog, in UTC.
schema_version string Yes Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped.
name string No The user-provided business name for the asset.
description string No The user-provided business description for the asset.
resource_name string No The resource's technical name.
resource_description string No The resource's technical description.
created_time timestamptz No Time the resource was created, in UTC.
region_name string No The AWS Region of the table.
data_format string No The data format, such as CSV, JSON, or Parquet.
data_location string No The storage location of the table data.
format string No The table format, such as Iceberg, Hudi, or Delta.
type string No The table type, such as EXTERNAL_TABLE or VIRTUAL_VIEW.
s3_table_column_count int No The number of top-level columns in the table's current schema, including any that are not in the columns collection.
s3_table_columns_status_enum string No Whether the columns collection holds every column of the table's current schema. Valid values: Complete, Truncated, Unavailable.
s3_table_compaction_status_enum string No Indicates whether automatic Iceberg compaction maintenance is enabled for the table. Valid values: Enabled, Disabled.
s3_table_encryption_type_enum string No The server-side encryption type configured for the table. Valid values: SseS3, SseKms.
s3_table_format_version int No The Apache Iceberg table format version.
s3_table_last_sequence_number long No The Apache Iceberg last sequence number of the table. It increases only when a snapshot is added, and is 0 for format version 1.
s3_table_managed_by_enum string No Indicates whether the table is created and managed by the customer or by AWS (for example, S3 Metadata tables). Valid values: Customer, Aws.
s3_table_managed_by_service string No The AWS service principal of the service that manages the table, for example, s3.amazonaws.com or sagemaker.amazonaws.com. Populated only when s3_table_managed_by_enum is Aws.
s3_table_metadata_location string No The S3 URI of the current Iceberg metadata file for this table.
s3_table_owner_account_id string No The 12-digit AWS account ID that owns the parent S3 table bucket.
s3_table_primary_key_columns list<string> No The names of the table's primary key columns (the Apache Iceberg identifier fields), in schema order.
s3_table_row_count long No The total number of records in the table's current snapshot.
s3_table_size_in_bytes long No The total size in bytes of the data files in the table's current snapshot.
s3_table_snapshot_management_status_enum string No Indicates whether automatic Iceberg snapshot management maintenance is enabled for the table. Valid values: Enabled, Disabled.
s3_table_source_table_arn string No The ARN of the source table when this table is a replica; absent for tables that are not replication targets.
s3_table_storage_class_enum string No The S3 storage class for the table's data; overrides the parent table bucket's storage class. Valid values: Standard, IntelligentTiering.
s3_table_bucket_arn string Yes The ARN of the parent S3 table bucket that contains this table.
s3_table_bucket_name string Yes The name of the parent S3 table bucket that contains this table.
s3_table_id string Yes The unique identifier of the table within the S3 table bucket.
s3_table_namespace string Yes The namespace that contains this table. A namespace is a logical grouping of tables, analogous to a database.
s3_table_version long No A version that increases with every commit to the table: the number of the table's current metadata file.
s3_table_warehouse_location string No The S3 URI of the warehouse location where this table's data and metadata are stored.
kms_key_id string No The identifier of the AWS KMS key that encrypts the resource at rest, as the source service reports it: a key ID, key ARN, alias name, or alias ARN.
s3_table_kms_key_arn string No The ARN of the AWS KMS key that encrypts the table. Populated only when s3_table_encryption_type_enum is SseKms.
belongs_to string No Fully qualified identifier of the container asset this asset is a member of.

s3tables.table_columns

Full name: "s3tablescatalog/aws-catalog"."s3tables"."table_columns". Partitioned by bucket(32, asset_id).

Contains the columns of each table in s3tables.tables. The asset_id column matches s3tables.tables.id.

Column Type Required Description
ingestion_time timestamptz Yes Time this column record was ingested into the system table, in UTC.
schema_version string Yes Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped.
asset_id string Yes Identifier of the table asset this column belongs to, matching s3tables.tables.id.
column_name string Yes Name of this column within the parent table.
description string No Description of the column.
data_type string No The Apache Iceberg type of the column. A struct, list, or map column carries the full type string, for example struct<city:string>.
field_id int No The Apache Iceberg field ID of the column, which stays the same when the column is renamed.
nullability_enum string No Whether the column accepts null values. Valid values: Nullable, NotNullable.
ordinal int No The one-based position of the column in the table's current schema.
partition_status_enum string No Whether the column is a source of the table's default partition spec. Valid values: PartitionKey, NotPartitionKey.
partition_transform string No The Apache Iceberg partition transform applied to the column, for example identity, day, or bucket[16]. Absent when the column is not a partition source.
primary_key_status_enum string No Whether the column is one of the table's primary key columns (the Apache Iceberg identifier fields). Valid values: PrimaryKey, NotPrimaryKey.

s3vectors.buckets

Full name: "s3tablescatalog/aws-catalog"."s3vectors"."buckets". Partitioned by bucket(32, id).

Contains your vector buckets (amazon.s3vectors::Bucket).

Column Type Required Description
id string Yes Unique identifier of the asset.
ingestion_time timestamptz Yes Time this asset record was ingested into the system table, in UTC.
update_time timestamptz No Time the asset was last updated in the AWS Glue Data Catalog, in UTC.
schema_version string Yes Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped.
created_time timestamptz No Time the vector bucket was created, in UTC.
bucket_name string Yes The name of the vector bucket.
resource_description string No The resource's technical description.
description string No The user-provided business description for the asset.
name string No The user-provided business name for the asset.

s3vectors.indexes

Full name: "s3tablescatalog/aws-catalog"."s3vectors"."indexes". Partitioned by bucket(32, id).

Contains the vector indexes in your vector buckets (amazon.s3vectors::Index).

Column Type Required Description
id string Yes Unique identifier of the asset.
ingestion_time timestamptz Yes Time this asset record was ingested into the system table, in UTC.
update_time timestamptz No Time the asset was last updated in the AWS Glue Data Catalog, in UTC.
schema_version string Yes Identifier of this system table's column layout. Changes when a column is added, removed, renamed, or retyped.
bucket_name string Yes The name of the vector bucket that contains the index.
bucket_arn string Yes The ARN of the vector bucket that contains the index.
index_name string Yes The name of the vector index.
created_time timestamptz No Time the index was created, in UTC.
dimension_count int Yes The number of dimensions in each vector stored in the index.
distance_metric_enum string Yes The distance metric used for vector similarity search. Valid values: Cosine, Euclidean.
vector_data_type_enum string Yes The numeric data type of each vector component. Valid values: Float32.
index_mode_enum string No The operating mode of the vector index. Absent when the index mode has not been determined. Valid values: Classic, Typed, Enhanced.
description string No The user-provided business description for the asset.
name string No The user-provided business name for the asset.
resource_description string No The resource's technical description.
belongs_to string No Fully qualified identifier of the container asset this asset is a member of.

Example queries

Example General purpose buckets created in the last 30 days
SELECT resource_name, created_time FROM "s3tablescatalog/aws-catalog"."s3"."buckets" WHERE created_time >= current_timestamp - interval '30' day ORDER BY created_time DESC;
Example General purpose buckets by namespace type
SELECT bucket_namespace_enum, count(*) AS buckets FROM "s3tablescatalog/aws-catalog"."s3"."buckets" GROUP BY 1;
Example Largest S3 tables by size
SELECT s3_table_bucket_name, s3_table_namespace, resource_name, s3_table_row_count, s3_table_size_in_bytes FROM "s3tablescatalog/aws-catalog"."s3tables"."tables" ORDER BY s3_table_size_in_bytes DESC LIMIT 20;
Example S3 tables with automatic compaction turned off
SELECT s3_table_bucket_name, s3_table_namespace, resource_name FROM "s3tablescatalog/aws-catalog"."s3tables"."tables" WHERE s3_table_compaction_status_enum = 'Disabled';
Example Indexes created in the last 30 days
SELECT index_name, bucket_name, created_time FROM "s3tablescatalog/aws-catalog"."s3vectors"."indexes" WHERE created_time >= current_timestamp - interval '30' day ORDER BY created_time DESC;
Example Indexes by dimension count, distance metric, and vector data type
SELECT dimension_count, distance_metric_enum, vector_data_type_enum, count(*) AS index_count FROM "s3tablescatalog/aws-catalog"."s3vectors"."indexes" GROUP BY 1, 2, 3 ORDER BY index_count DESC;
Example Number of indexes in each vector bucket
SELECT b.bucket_name, count(i.index_name) AS index_count FROM "s3tablescatalog/aws-catalog"."s3vectors"."buckets" b LEFT JOIN "s3tablescatalog/aws-catalog"."s3vectors"."indexes" i ON i.bucket_name = b.bucket_name GROUP BY b.bucket_name ORDER BY index_count DESC;