Skip to content

Commit 3d8b2d2

Browse files
authored
docs: s3 tables (#292)
1 parent b2e7b8d commit 3d8b2d2

File tree

1 file changed

+169
-0
lines changed

1 file changed

+169
-0
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
title: "S3 Tables"
3+
description: Get started with Amazon S3 Tables on LocalStack
4+
persistence: supported
5+
tags: ["Ultimate"]
6+
---
7+
8+
import FeatureCoverage from "../../../../components/feature-coverage/FeatureCoverage";
9+
10+
## Introduction
11+
12+
Amazon S3 Tables is a managed Apache Iceberg table catalog that uses S3 storage.
13+
It acts as a catalog that transparently manages the underlying S3 buckets for you, providing built-in maintenance features like automatic compaction and snapshot management.
14+
It is designed for analytics workloads that need high read/write throughput and simplified table operations without having to directly manage S3 bucket infrastructure.
15+
16+
LocalStack lets you use the S3 Tables API locally to create table buckets, organize tables in namespaces, and manage table metadata locations.
17+
The supported APIs are available on the [API coverage section](#api-coverage), which provides information on the extent of S3 Tables' integration with LocalStack.
18+
19+
## Getting started
20+
21+
This guide is designed for users new to S3 Tables and assumes basic knowledge of the AWS CLI and our [`awslocal`](https://github.com/localstack/awscli-local) wrapper script.
22+
23+
Start your LocalStack container using your preferred method.
24+
We will demonstrate how to create a table bucket, a namespace, a table, and how to retrieve table details and metadata location with the AWS CLI.
25+
26+
### Create a table bucket
27+
28+
You can create a table bucket to store S3 Tables using the [`CreateTableBucket`](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3Buckets_CreateTableBucket.html) API.
29+
30+
Run the following command to create a table bucket named `my-table-bucket`:
31+
32+
```bash
33+
awslocal s3tables create-table-bucket --name my-table-bucket
34+
```
35+
36+
```bash title="Output"
37+
{
38+
"arn": "arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket"
39+
}
40+
```
41+
42+
### Create a namespace
43+
44+
Namespaces help organize tables within a table bucket. You can create a namespace within the table bucket using the [`CreateNamespace`](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3Buckets_CreateNamespace.html) API.
45+
46+
Run the following command to create a namespace named `my_namespace` within the table bucket `my-table-bucket`:
47+
48+
```bash
49+
awslocal s3tables create-namespace \
50+
--table-bucket-arn arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket \
51+
--namespace my_namespace
52+
```
53+
54+
```bash title="Output"
55+
{
56+
"tableBucketARN": "arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket",
57+
"namespace": [
58+
"my_namespace"
59+
]
60+
}
61+
```
62+
63+
### Create a table
64+
65+
You can also create a table within the namespace with the [`CreateTable`](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3Tables_CreateTable.html) API.
66+
67+
Run the following command to create a table named `my_table` within the namespace `my_namespace`:
68+
69+
```bash
70+
awslocal s3tables create-table \
71+
--table-bucket-arn arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket \
72+
--namespace my_namespace \
73+
--name my_table \
74+
--format ICEBERG
75+
```
76+
77+
```bash title="Output"
78+
{
79+
"tableARN": "arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket/table/my_table",
80+
"versionToken": "0c0c1509"
81+
}
82+
```
83+
84+
### Retrieve table information
85+
86+
You can describe the table to view details such as ARN, namespace, format, and warehouse location using the [`GetTable`](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3Tables_GetTable.html) API.
87+
88+
Run the following command to describe the table `my_table`:
89+
90+
```bash
91+
awslocal s3tables get-table \
92+
--table-bucket-arn arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket \
93+
--namespace my_namespace \
94+
--name my_table
95+
```
96+
97+
```bash title="Output"
98+
{
99+
"name": "my_table",
100+
"type": "customer",
101+
"tableARN": "arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket/table/my_table",
102+
"namespace": [
103+
"my_namespace"
104+
],
105+
"namespaceId": "380d99d1-abbf-4121-8e2c-c9a06e2def06",
106+
"versionToken": "0c0c1509",
107+
"warehouseLocation": "s3://hqpdve6ni1lb7w5bdn24lruswomtsh5bdrw66oip--table-s3",
108+
"createdAt": "2025-10-23T15:34:59.193399Z",
109+
"createdBy": "000000000000",
110+
"modifiedAt": "2025-10-23T15:34:59.193400Z",
111+
"ownerAccountId": "000000000000",
112+
"format": "ICEBERG",
113+
"tableBucketId": "bead5f2e-405f-4c66-b8f3-545f89ee1058"
114+
}
115+
```
116+
117+
### Retrieve table metadata location
118+
119+
You can fetch the warehouse location used for table metadata using the [`GetTableMetadataLocation`](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3Tables_GetTableMetadataLocation.html) API.
120+
121+
Run the following command to fetch the warehouse location for the table `my_table`:
122+
123+
```bash
124+
awslocal s3tables get-table-metadata-location \
125+
--table-bucket-arn arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket \
126+
--namespace my_namespace \
127+
--name my_table
128+
```
129+
130+
```bash title="Output"
131+
{
132+
"versionToken": "0c0c1509",
133+
"metadataLocation": "s3://hqpdve6ni1lb7w5bdn24lruswomtsh5bdrw66oip--table-s3/metadata/00000-b6d96c57-403a-4387-ac59-ec55ac2e646b.metadata.json",
134+
"warehouseLocation": "s3://hqpdve6ni1lb7w5bdn24lruswomtsh5bdrw66oip--table-s3"
135+
}
136+
```
137+
138+
### List tables in a namespace
139+
140+
You can list tables in the `my_namespace` namespace using the [`ListTables`](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3Tables_ListTables.html) API.
141+
142+
Run the following command to list tables in the namespace `my_namespace`:
143+
144+
```bash
145+
awslocal s3tables list-tables \
146+
--table-bucket-arn arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket \
147+
--namespace my_namespace
148+
```
149+
150+
```bash title="Output"
151+
{
152+
"tables": [
153+
{
154+
"namespace": [
155+
"my_namespace"
156+
],
157+
"name": "my_table",
158+
"type": "customer",
159+
"tableARN": "arn:aws:s3tables:us-east-1:000000000000:bucket/my-table-bucket/table/my_table",
160+
"createdAt": "2025-10-23T15:34:59.193399Z",
161+
"modifiedAt": "2025-10-23T15:34:59.193400Z"
162+
}
163+
]
164+
}
165+
```
166+
167+
## API Coverage
168+
169+
<FeatureCoverage service="s3tables" client:load />

0 commit comments

Comments
 (0)