Skip to main content

Amazon Athena

Query Engine Support

Amazon Athena supports two open-source query engines: Apache Spark and Trino. Wren AI only supports Trino engine.

To add an Amazon Athena connection, click on the Athena option in Connect a data source section. connect

Prerequisites

AWS Account and Permissions

You'll need an AWS account with appropriate permissions to access Amazon Athena. The user or role you use to connect should have the following permissions:

  • AmazonAthenaFullAccess policy, or at minimum:
    • Permissions to run Athena queries
    • Full access to the S3 bucket where query results are stored
    • Read access to metadata from AWS Glue Data Catalog

Connect

Fill in the connection settings: athena

Display name

The display name for the database in the Wren AI interface.

Database (schema)

The Athena database (also called schema) that contains the tables you want to query.

S3 staging directory

The S3 path where Athena stores query results and metadata. You can find this in the Athena console under Settings > Query result location.

AWS region

The AWS region where your Athena service is located (e.g., us-east-1, eu-west-1, ap-southeast-1).

AWS access key ID

Your AWS access key ID.

AWS secret access key

Your AWS secret access key corresponding to the access key ID.

Click Next to start connection and go to the next step.

Select Tables

All tables of your connected Athena database will be listed in this step. Select which tables you want to use in Wren AI. Each selected table will be created as a data model. See the Modeling documentations to learn more about what is data models. select_table

Define relationships

Define the relationships among selected tables in this step. If you have defined primary keys and foreign keys in your Athena dataset, we will list suggested relationships based on the information. If not, you can also add relationships by clicking the Add relationships button on the table blocks. relationship

Define following properties in a relationship:

  • From: Select the left side table and column of this relationship.
  • To: Select the right side table and column of this relationship.
  • Relationship Type: Select the type of relationship. add_relationship

Find more information about relationship in Modeling - Working with Relationships

You can also skip this step and finish connection.

Known Issues

Query Timeout

Athena queries may timeout for complex operations or large datasets. Consider optimizing your queries or using partitioning to improve performance.

Data Type Limitations

Some Athena data types may not be fully supported in Wren AI. If you encounter issues with specific data types, consider casting them to more standard types in your Athena queries.