dbt-athena-community
The community-maintained dbt adapter that lets you build, test, and run data transformations directly on Amazon Athena.
Repository Health
Technical Analysis
dbt-athena-community is the open-source dbt adapter for Amazon Athena, the serverless interactive query service built on Presto/Trino. It plugs into dbt Core so analytics engineers can model, materialize, and test their data warehouse using Athena as the compute and query engine over data in Amazon S3.
The package is a thin community distribution that pins and re-exports the dbt-athena adapter, wiring Athena’s SQL dialect, table and Iceberg materializations, incremental strategies, and AWS Glue Data Catalog integration into dbt’s standard workflow.
What You Get
- A dbt adapter that targets Amazon Athena as the query engine over S3 data lakes.
- Support for table, view, incremental, and Apache Iceberg materializations.
- Automatic AWS Glue Data Catalog integration for schema and table registration.
- Snapshot, seed, and highly-available (HA) table support tailored to Athena’s semantics.
Common Use Cases
- Building an ELT pipeline on an S3 data lake using dbt and serverless Athena compute.
- Managing incremental models and Iceberg tables without provisioning warehouse infrastructure.
- Standardizing analytics transformations across a team that already queries data through Athena.
Under The Hood
Architecture
The package (dbt-athena-community/src) is a distribution shim whose sole dependency is a version-locked dbt-athena, which contains the real adapter under dbt/adapters/athena. dbt Core loads the adapter through its plugin entry point; the adapter translates dbt’s relation, materialization, and connection abstractions into Athena SQL, submits queries via boto3, and registers resulting tables in the AWS Glue Data Catalog.
Tech Stack
Python 3.10+ built on dbt-adapters, dbt-common, and dbt-core, with boto3 and boto3 stubs for AWS access, pyathena for the Athena DB-API connection, mmh3 for hashing, pydantic for config models, and tenacity for retry logic. Packaged with hatchling.
Code Quality
The code lives in the well-maintained dbt Labs dbt-adapters monorepo with a dedicated tests suite (unit and functional), mypy typing enforced via mypy.ini, black formatting, and CI across Python 3.10-3.12. The community package itself is intentionally minimal, delegating all logic to the tested dbt-athena core.
API Design
Developers configure the adapter entirely through a dbt profiles.yml target and model-level config blocks, matching the ergonomics of every other dbt adapter. Athena-specific options (table_type, format, partitioned_by, s3_data_dir) are exposed as standard dbt config, so the learning curve is limited to Athena’s own concepts rather than a new API surface.