You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LocalStack Athena can query [S3 Tables](/aws/services/s3tables/) through Glue federated catalogs, mirroring the AWS workflow that bridges S3 Tables, Glue, and Athena into a single query path.
224
+
This lets you point Athena at a table bucket and run SQL against the Iceberg tables it manages without copying data into a separate warehouse.
225
+
226
+
The flow is the same as on AWS:
227
+
228
+
1. Create a table bucket and namespaces in S3 Tables.
229
+
2. Register a Glue federated catalog (conventionally named `s3tablescatalog`) that delegates metadata to S3 Tables.
230
+
3. Register an Athena data catalog with `Type=GLUE` whose `catalog-id` parameter points to a specific table bucket via the federated catalog (`s3tablescatalog/<bucket-name>`).
231
+
4. Reference the Athena data catalog in`QueryExecutionContext` when running queries.
232
+
233
+
### Create S3 Tables resources
234
+
235
+
Create a table bucket and a namespace in S3 Tables.
236
+
The bucket holds your Iceberg tables and the namespace organizes them.
Register a Glue catalog that federates to S3 Tables using the [`CreateCatalog`](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-Catalogs.html#aws-glue-api-catalog-CreateCatalog) API.
266
+
The catalog name `s3tablescatalog` matches the AWS convention used by Athena, EMR, and Redshift.
Register an Athena data catalog that points at a specific table bucket using the [`CreateDataCatalog`](https://docs.aws.amazon.com/athena/latest/APIReference/API_CreateDataCatalog.html) API.
288
+
The `catalog-id` parameter follows the format `s3tablescatalog/<bucket-name>` so that Athena routes queries through the federated catalog path.
You can also use the catalog-id reference (`s3tablescatalog/<bucket-name>`) directly in`QueryExecutionContext.Catalog`if you prefer not to register a named Athena data catalog.
376
+
377
+
:::note
378
+
Query execution against the federated catalog routes through Trino's Iceberg connector inside the LocalStack bigdata container.
379
+
The first query may take several minutes while LocalStack downloads and starts the bigdata dependencies.
380
+
Subsequent queries reuse the running services.
381
+
:::
382
+
221
383
## Client configuration
222
384
223
385
You can configure the Athena service in LocalStack with various clients, such as [PyAthena](https://github.com/laughingman7743/PyAthena/), [awswrangler](https://github.com/aws/aws-sdk-pandas), among others!
LocalStack [Athena](/aws/services/athena/) can query S3 Tables data through a Glue federated catalog.
170
+
Once you register a federated `s3tablescatalog` in Glue and add a matching Athena data catalog, you can run SQL against your S3 Tables namespaces and tables directly from Athena.
171
+
172
+
See [S3 Tables in the Athena documentation](/aws/services/athena/#s3-tables) for the full workflow.
0 commit comments