View a markdown version of this page

Differences with local DuckDB - Amazon Athena

Differences with local DuckDB

The extension connects a local DuckDB session to Athena. The following table describes how this changes query execution and data access.

AreaLocal queries without the Athena extensionQueries through the Athena extension
ExecutionLocal operations run in the local session.Eligible statements run on Athena. Local joins and other operations can remain in DuckDB.
ComputeLocal operators use the resources of the host machine.Remote operations use Athena compute; local operations still use the host machine.
Table accessUse the files and catalogs available to the local session.Attach an Athena workgroup to query Data Catalog and S3 Tables tables.
Table namesNames resolve in the local catalog and search path.Qualify remote tables as alias.database.table, or select the attached catalog or database with USE. Nested schema paths are not supported.
TransferLocal operators consume the data they read.Athena returns query results. A per-table read without a remote filter can return the whole table.
SQLSQL runs in the local DuckDB session.Use SQL supported by DuckDB for remote operations.
MetadataInspect the objects available to the local session.Catalog listing can require metadata requests for multiple databases. Filter listings to the database you need.
InstallationEach extension has its own installation requirements.Register the AWS repository and explicitly install a compatible Athena extension for the client version and platform.
CredentialsCredential requirements depend on the files, catalogs, and extensions used.The Athena extension signs with DuckDB aws or s3 secrets. Select a secret with the Secret ATTACH option.
Access controlAccess depends on the local files and connected services.Athena receives requests under the signing identity. Follow the engine's data-access requirements and limitations.
CostLocal execution uses your host resources; connected services can charge for their use.Athena query pricing applies to statements that run on Athena.

Queries run with the selected signing identity, and Athena applies that identity's permissions. For data access requirements and current Lake Formation limitations, see Security and permissions.

Metadata caching defaults to transaction scope. Connection-scoped caching retains metadata until invalidation; it does not make all later listings permanently current. See Metadata. The local client and remote engine are separate installations; use SQL supported by the engine for remote operations.

For query charges and additional service costs, see Amazon Athena pricing on the AWS website.

Choosing how to reach your data from DuckDB
PathUse it when
The iceberg extension with a Glue or S3 Tables Iceberg REST endpointYou want the local DuckDB session to read Iceberg tables directly.
The glue extensionYou want the local DuckDB session to read Hive tables directly.
The athena extensionYou want to query Hive and Iceberg tables through an Athena workgroup and submit eligible operations to Athena compute.

The first two paths use their own extension and credential configuration. They do not submit the read to an Athena workgroup.