Skip to main content

The athena adapter plugin for dbt (data build tool)

Project description

dbt-athena

Note: this repository is not actively maintained. You can find a newer version of the adapter with Athena Engine 2 support, seeds and more in the following repository:

https://github.com/Tomme/dbt-athena/

Installation

This plugin can be installed via pip:

$ pip install git+https://github.com/Dandandan/dbt-athena.git

Configuring your profile

A dbt profile can be configured to run against Athena using the following configuration:

Option Description Required? Example
s3_staging_dir The location where Athena stores meta info Required s3://bucket/staging
schema Specify the schema (athena database) to build models into Required dev
database Data catalog Required awsdatacatalog
region_name Specify in which AWS region it should connect Required eu-west-1
threads How many threads dbt should use Optional(default=1) 8
max_retry_number Number for retries for exponential backoff Optional(default=5) 8
max_retry_delay Maximum delay for exponential backoff in seconds Optional(default=100) 8

Example profiles.yml entry:

athena:
  target: athena
  outputs:
    athena:
      type: athena
      database: awsdatacatalog
      schema: dev
      region_name: eu-west-1
      threads: 8
      s3_staging_dir: s3://athena-staging-bucket/

Usage Notes

Supported Functionality

Due to the nature of Athena, not all core dbt functionality is supported. The following features of dbt are not implemented on Athena:

  • Archival
  • Incremental models

If you are interested in helping to add support for this functionality in dbt on Athena, please open an issue!

Known issues:

  • Quoting is not supported

Reporting bugs and contributing code

  • Want to report a bug or request a feature? Let us know on Slack, or open an issue.

Running the tests

Unit tests

  1. Install tox:
pip install tox
  1. Run unit tests:
tox -e unit

Integration tests

At this time, an AWS account is not provided in order to run the tests in CI. We kindly ask contributors/reviewers to use their own AWS accounts in order to test contributions.

You can also reach out in the Slack #athena channel for someone to run the tests for you.

Steps:

  1. Clone the dbt-integration-tests repository
git clone --branch athena-support https://github.com/EarnestResearch/dbt-integration-tests.git
  1. Run the tests:

Additionally, you might need to set the AWS_PROFILE environment variable if you use another value than "default" (for example if you connect to multiple AWS accounts or assume different IAM roles)

AWS_DEFAULT_REGION=us-west-2 ATHENA_S3_STAGING_DIR=s3://dbt-athena-integration-tests/tests/ DBT_PROFILES_DIR=$(pwd)/test/integration/ tox -e integration-athena

Code of Conduct

Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PyPA Code of Conduct.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt-athena-0.0.5.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

dbt_athena-0.0.5-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file dbt-athena-0.0.5.tar.gz.

File metadata

  • Download URL: dbt-athena-0.0.5.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for dbt-athena-0.0.5.tar.gz
Algorithm Hash digest
SHA256 823a7cd18d04147080e1c4b6f7f17acd4d90ca4d153dd9bd49d88b60a2adf184
MD5 105e3ce12a251f7bb9e4a998e0795e7b
BLAKE2b-256 f7dd354b6b64149fb019dbb5a4085a31edd27fb813f560ade1bd4b267a1c0a10

See more details on using hashes here.

File details

Details for the file dbt_athena-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: dbt_athena-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for dbt_athena-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 be5661d9cc6b61cf63e45cfe761039366f324b6580496740704134fae31b8757
MD5 680b916648e164a1593dfcc5aa3320f3
BLAKE2b-256 656a1c316efe6820da7f35df17ff05d1f17da51eff2d1800292e8c58f734707c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page