Skip to main content

Amazon Athena

Available for SeekWell

Use this database with SeekWell for analysis. Connect your data to SeekWell using a new connection or credentials copied from an existing Extract connector.

Overview​

Extract connects to Amazon Athena as a data source, enabling you to query data in your AWS data lake using standard SQL. This connector uses the native AWS SDK (not JDBC) for efficient query execution and result retrieval.

For SeekWell, Athena supports full query results with direct S3 CSV downloads for large datasets. For Extract ingestion, the connector supports optional named SQL datasets with Full Refresh mode.

How Extract Queries Athena​

Extract uses the AWS SDK to submit queries to Athena and retrieve results. This approach offers:

  • Native AWS integration via explicit IAM credentials
  • Efficient result handling with bounded memory usage
  • Direct S3 CSV downloads for large SeekWell results (files over 100 KB)
  • Bounded inline previews for smaller results (up to 200 rows)

Query execution behavior​

  • Queries execute with a 120-second deadline
  • Results transfer with a 15-minute deadline for Extract ingestion
  • NULL values are preserved distinctly from empty strings
  • Integer and boolean columns retain their types; decimals, timestamps, and complex values remain as text to avoid precision loss

Prerequisites​

Before configuring the Amazon Athena source connector, ensure you have:

  1. An AWS account with Athena access
  2. An Athena Engine version 3 workgroup with its own S3 result location
  3. IAM credentials (access key and secret key) with appropriate permissions
  4. Network access to AWS from Extract's servers

Required IAM permissions​

Create an IAM policy with the following permissions:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"athena:StartQueryExecution",
"athena:StopQueryExecution",
"athena:GetQueryExecution",
"athena:GetQueryResults",
"athena:GetWorkGroup",
"athena:ListDatabases",
"athena:ListTableMetadata",
"athena:GetTableMetadata"
],
"Resource": [
"arn:aws:athena:<region>:<account-id>:workgroup/<workgroup-name>"
]
},
{
"Effect": "Allow",
"Action": [
"glue:GetDatabase",
"glue:GetDatabases",
"glue:GetTable",
"glue:GetTables",
"glue:GetPartitions"
],
"Resource": [
"arn:aws:glue:<region>:<account-id>:catalog",
"arn:aws:glue:<region>:<account-id>:database/<database-name>",
"arn:aws:glue:<region>:<account-id>:table/<database-name>/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::<source-data-bucket>",
"arn:aws:s3:::<source-data-bucket>/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::<query-results-bucket>",
"arn:aws:s3:::<query-results-bucket>/*"
]
}
]
}

Replace the placeholder values with your actual AWS account ID, region, workgroup name, database name, and bucket names.

Encryption requirements

SSE-S3 and SSE-KMS encryption are supported for query results. Client-side encryption (CSE-KMS) is not supported because the connector reads results directly from S3 as CSV.

Deny dangerous actions​

For security, explicitly deny mutations and dangerous actions:

{
"Effect": "Deny",
"Action": [
"glue:CreateTable",
"glue:UpdateTable",
"glue:DeleteTable",
"s3:PutObject",
"s3:DeleteObject",
"lambda:InvokeFunction"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"s3:prefix": "<query-results-prefix>/*"
}
}
}

Setup Guide​

Step 1: Create or identify an Athena workgroup​

Ensure you have an Athena Engine version 3 workgroup configured with:

  • Query result location: An S3 bucket you own for storing query results
  • Encryption: SSE-S3 or SSE-KMS (not CSE-KMS)

To check your workgroup configuration in the AWS Console:

  1. Navigate to Amazon Athena > Workgroups
  2. Select your workgroup and verify the engine version is Athena engine version 3
  3. Note the Query result location S3 path

Step 2: Create IAM credentials​

Create an IAM user or role with the permissions described above:

  1. Navigate to IAM > Users > Create user
  2. Attach the policy with the required Athena, Glue, and S3 permissions
  3. Create an access key and note the Access Key ID and Secret Access Key

Step 3: Configure the Amazon Athena source in Extract​

In the Extract platform, configure the Amazon Athena source connector with the following parameters:

Connection Settings:

ParameterTypeRequiredDescription
regionstringYesAWS region where your Athena workgroup is located (e.g., us-east-1). Must be a valid region name.
databasestringYesAthena data catalog name. This is typically AwsDataCatalog for the default Glue catalog, or a custom catalog name.
workgroupstringYesName of the Athena workgroup to use for query execution. Must be Engine version 3.
access_key_idstringYesAWS IAM Access Key ID with Athena and S3 permissions.
secret_access_keystringYesAWS IAM Secret Access Key.
session_tokenstringNoAWS session token for temporary credentials. Required when using AWS STS temporary credentials.

Dataset Configuration (for Extract ingestion):

ParameterTypeRequiredDescription
datasetsarrayNoNamed SQL datasets for Extract ingestion. Each dataset has a name and sql field.

Step 4 (Optional): Whitelist Extract's Server IPs​

If your S3 bucket or VPC has network restrictions, whitelist Extract's server IPs:

  • 3.134.124.160/32
  • 3.150.64.207/32
  • 44.232.26.19/32
  • 54.214.149.234/32

Data Streams​

This connector exposes the following streams:

  • Tables: Tables and views available in the configured Athena database, including partition columns.
  • Columns: Column metadata for the discovered tables.

If your workspace applies table selection rules, metadata export respects that selection and only includes the selected tables and their columns.

Extract Ingestion​

For Extract pipelines (not SeekWell), you can configure named SQL datasets that will be extracted on a schedule.

Dataset requirements​

  • Names: Must be 1-63 ASCII letters, digits, or underscores, starting with a letter or underscore. Names are case-insensitive and must be unique.
  • SQL: Must be a read-only SELECT or WITH query. Mutations and metadata discovery queries are rejected.
  • Mode: Only Full Refresh is supported. Incremental extraction and diffing are not available.

Schema discovery​

Extract discovers the schema by running your query wrapped with LIMIT 0. The connector safely handles trailing comments and semicolons in your SQL.

SeekWell Query Results​

When querying Athena through SeekWell:

  • Small results (under 100 KB CSV): Returned inline with up to 200 preview rows
  • Large results (100 KB+ CSV): A presigned S3 download URL is provided, valid for up to 15 minutes

Download URLs are direct access to your query result CSV in S3. Changing SeekWell access does not revoke already-issued URLs; they expire naturally. Your S3 bucket lifecycle policies control result retention.

Notes​

  • Read-only enforcement: Extract validates that queries are read-only SELECT/WITH statements. Mutations, DDL, and session-state changes are rejected.
  • Metadata discovery blocked: Queries against INFORMATION_SCHEMA or similar metadata views are blocked in SeekWell. Use Extract's metadata tools instead.
  • No managed result storage: This connector requires customer-owned S3 storage for query results. Managed result storage is not supported.

Troubleshooting​

IssueResolution
Authentication failedVerify your access key, secret key, and optional session token are correct and not expired.
Workgroup not foundConfirm the workgroup name and region are correct. The workgroup must exist and be accessible with your credentials.
Engine version errorAthena Engine version 3 is required. Update your workgroup configuration in the AWS Console.
Query timeoutQueries have a 120-second execution deadline. Optimize your query or increase workgroup limits.
CSE-KMS encryption errorClient-side encryption is not supported. Configure your workgroup to use SSE-S3 or SSE-KMS instead.
Download URL expiredPresigned URLs are valid for up to 15 minutes. Rerun the query to get a fresh download link.
Dataset name rejectedDataset names must be 1-63 characters using only ASCII letters, digits, and underscores, starting with a letter or underscore.