

# Amazon Kinesis Data Streams System Tables

AWS services offer system tables: read-only Apache Iceberg tables in your account that hold data about your resources and activity, which you can query with SQL. For an overview, see [Working with system tables](https://docs.aws.amazon.com/AmazonS3/latest/userguide/working-with-system-tables.html) in the *Amazon S3 User Guide*.

With system tables for Amazon Kinesis Data Streams, an inventory of your streams is stored in a table that you can query to review configuration across your streams. The table is stored as a fully managed table in Amazon S3 Tables, in Apache Iceberg format. You can query it with Amazon Athena, Amazon Redshift, or any other engine that is compatible with Apache Iceberg.

With this table, you can do the following.
+ Count streams by capacity mode and encryption.
+ Find the streams with the longest retention.

**Topics**
+ [How Amazon Kinesis Data Streams system tables work](#system-tables-how-it-works)
+ [Storage location](#system-tables-storage-location)
+ [Supported system tables](#system-tables-supported)
+ [Enabling system tables](#system-tables-enabling)
+ [Schema and example queries](#system-tables-schema-queries)
+ [Amazon Kinesis Data Streams system tables schema and example queries](system-tables-schema.md)

## How Amazon Kinesis Data Streams system tables work
<a name="system-tables-how-it-works"></a>

AWS Glue Data Catalog writes the Amazon Kinesis Data Streams system table to the aws-catalog table bucket in your account and Region. After you turn on auto-discovery and metadata export in AWS Glue Data Catalog, it writes an inventory of your Amazon Kinesis Data Streams resources and keeps it up to date as your resources change.

AWS manages the table for you, including the schema, partitioning, compaction, and snapshots. The table is read-only. You control who can read it.

For how system tables work across AWS services, see [Working with system tables](https://docs.aws.amazon.com/AmazonS3/latest/userguide/working-with-system-tables.html) in the *Amazon S3 User Guide*.

## Storage location
<a name="system-tables-storage-location"></a>

The table is stored in the aws-catalog table bucket, in the kinesis namespace. Other AWS services store their resource system tables in the same bucket, each in its own namespace.

```
aws-catalog/                      # S3 Tables bucket (one per account and Region)
  +-- kinesis/                    # Namespace
  +-- streams/                # Table
```

The following query returns 10 rows from the streams table.

```sql
SELECT * FROM "s3tablescatalog/aws-catalog"."kinesis"."streams" LIMIT 10;
```

## Supported system tables
<a name="system-tables-supported"></a>

Amazon Kinesis Data Streams has the following system table:

streams  
one row for each stream in your account and Region.

## Enabling system tables
<a name="system-tables-enabling"></a>

To turn on and query the table, see Turning on resource system tables and Permissions for querying system tables in Working with system tables in the Amazon S3 User Guide.

## Schema and example queries
<a name="system-tables-schema-queries"></a>

For the columns and example queries of the table, see [Amazon Kinesis Data Streams system tables schema and example queries](system-tables-schema.md).