Skip to content

Commit

Permalink
DH-4653 Add support for AWS Athena
Browse files Browse the repository at this point in the history
  • Loading branch information
jcjc712 committed Sep 14, 2023
1 parent 7fba22d commit 9d27460
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Once the engine is running, you will want to use it by:
3. Querying the data in natural language

### Connecting to your data warehouses
We currently support connections to Postgres, BigQuery, Databricks and Snowflake. You can create connections to these warehouses through the API or at application start-up using the envars.
We currently support connections to Postgres, BigQuery, Databricks, Snowflake and AWS Athena. You can create connections to these warehouses through the API or at application start-up using the envars.

#### Connecting through the API

Expand Down Expand Up @@ -216,6 +216,11 @@ You can generate the `connection_uri` parameter in the API call for each of the
"connection_uri": snowflake://<user>:<password>@<organization>-<account-name>/<database>/<schema>
```

**AWS Athena**
```
"connection_uri": awsathena+rest://<aws_access_key_id>:<aws_secret_access_key>@athena.<region_name>.amazonaws.com:443/<schema_name>?s3_staging_dir=<s3_staging_dir>&work_group=primary
```

**BigQuery**
To connect to BigQuery you should create a json credential file. Please follow Steps 1-3 under "Configure
BigQuery Authentication in Google Cloud Platform" in
Expand Down
12 changes: 11 additions & 1 deletion docs/api.create_database_connection.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Create a Database connection
=============================

We currently support connections to the following data warehouses: ``databricks``, ``postgresql``, ``snowflake``, ``bigquery``. All sensitive connection data
We currently support connections to the following data warehouses: ``databricks``, ``postgresql``, ``snowflake``, ``bigquery`` and ``AWS Athena``. All sensitive connection data
is encrypted using the key you provide in your .env file before being stored to the application storage.

You can also specify the engine to connect to the Database through an SSH tunnel, as demonstrated in the second example below.
Expand Down Expand Up @@ -147,6 +147,16 @@ Example::

"connection_uri": snowflake://jon:123456@foo-bar/my-database/public

AWS Athena
^^^^^^^^^^^^

Uri structure::

"connection_uri": awsathena+rest://<aws_access_key_id>:<aws_secret_access_key>@athena.<region_name>.amazonaws.com:443/<schema_name>?s3_staging_dir=<s3_staging_dir>&work_group=primary

Example::

"connection_uri": awsathena+rest://foobar:foobar@athena.us-east-2.amazonaws.com:443/db_test?s3_staging_dir=s3://my-bucket/output/&work_group=primary

BigQuery
^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ sphinx==6.2.1
sphinx-book-theme==1.0.1
boto3==1.28.38
botocore==1.31.38
PyAthena==3.0.6

0 comments on commit 9d27460

Please sign in to comment.