Skip to main content
This article guides you through the process of connecting Amazon Athena to Upsolve, allowing you to query your S3 data lake within the Upsolve platform. Athena is serverless — there is no cluster or host to provision. Instead of a network endpoint and database login, you connect with an AWS IAM key pair and tell Athena where to stage its results in S3.

Prerequisites

Before you start, you will need the following from AWS:
  • Region — where your Athena workgroup and Glue catalog live (e.g. us-east-1)
  • Access Key ID and Secret Access Key — for an IAM user or service account
  • S3 output location — an S3 URI Athena writes query results to (e.g. s3://my-bucket/athena-results/)
  • Database — the database unqualified table names resolve against at query time
  • Schemas (optional but recommended) — comma-separated schemas to introspect, with * wildcards, e.g. dw,domain_*_mart*. Empty falls back to the Database field, then to every schema in the catalog.
  • Data catalog (optional, defaults to AwsDataCatalog)
  • Workgroup (optional, defaults to primary)
Athena has no username or password. The IAM key pair is the equivalent — the official Athena JDBC driver maps the Access Key ID to User and the Secret Access Key to Password, and Upsolve follows the same convention.
Follow the steps below to obtain them:
  1. Go to the AWS Management Console and open Athena. Confirm the region shown in the top-right corner — this is the region you will enter in Upsolve.
  2. Under Query editor → Settings, check the Location of query result. If it is blank, set it to an S3 prefix you control. This is your S3 output location.
  3. In Data sources, note the data catalog (usually AwsDataCatalog) and the database containing your tables. If your tables are not yet catalogued, run an AWS Glue crawler over your S3 data first.
  4. Open IAM and create (or reuse) a user for Upsolve, then create an access key for it. Save the secret when it is shown — AWS will not display it again.

IAM permissions

Attach a policy granting the Upsolve key pair at least:
  • athena:StartQueryExecution, athena:GetQueryExecution, athena:GetQueryResults, athena:StopQueryExecution, athena:GetWorkGroup
  • glue:GetDatabase, glue:GetDatabases, glue:GetTable, glue:GetTables, glue:GetPartition, glue:GetPartitions — for the databases you expose
  • s3:GetObject, s3:PutObject, s3:AbortMultipartUpload, s3:ListBucket, s3:GetBucketLocation on the output location
  • s3:GetObject, s3:ListBucket, s3:GetBucketLocation on the buckets your tables read from
Without write access to the output location, every query fails: Athena stages each result set in S3 before it can be read back.
s3:ListBucket and s3:GetBucketLocation are bucket-level actions and cannot be scoped to a sub-directory by resource ARN — granting them on arn:aws:s3:::bucket/prefix/* silently never matches. Use the s3:prefix condition key, or give Athena a dedicated results bucket. An error mentioning “an explicit deny in a resource-based policy” means the bucket policy is denying the call, and no identity-policy grant can override it.
If the connection saves but the data model is empty, the Athena and results-bucket permissions are working and Glue or source-bucket access is not — the connection test runs SELECT 1+1, which reads no table.

Connecting Amazon Athena to Upsolve

Now that you have your requirements, you can connect it to Upsolve using the following steps:
  1. Navigate to the connections page in Upsolve.
  2. Click to add a new connection and select Athena as your data source type.
  3. Enter a name for your connection, then fill in the details:
  • Region
  • Access Key ID
  • Secret Access Key
  • S3 output location
  • Database
  • Data catalog (optional)
  • Workgroup (optional)
  1. Click “Test & Create Connection” to validate the credentials and create your Athena connection.
Congratulations! You’ve successfully created a new data source between Amazon Athena and Upsolve.

Things to know about Athena

  • Athena uses Trino/Presto SQL. Identifiers are double-quoted, and date handling uses date_trunc and date_format rather than their Postgres or MySQL equivalents.
  • Queries are billed per byte scanned. Upsolve therefore disables automatic selectable-column detection for Athena connections — detecting it would run a COUNT per table on every metadata refresh. Partitioning your tables and filtering on the partition keys is the most effective way to control cost.
  • Executions are asynchronous. Upsolve polls until a query completes and gives up after 120 seconds.
  • Scope your schemas. Athena’s information_schema spans the whole catalog. On a catalog with thousands of schemas, introspecting all of them is slow — AWS recommends against it — so set the Schemas field to just the ones you need.
The specific steps for connecting Amazon Athena may vary based on your unique setup. If you encounter any difficulties or have questions, please don’t hesitate to contact our Support Team for assistance.