> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/2024-02-08/guides/configuring-your-connections/connections/awsathena/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.
# AWS Athena
Supports:
* ✅ Models
* ✅ Model sync destination
* ✅ Bulk sync source
* ✅ Bulk sync destination
## Connection
### Configuration
| Name | Type | Description | Required |
auth_mode |
string |
Authentication method
How to authenticate with AWS. Defaults to Access Key and Secret. Accepted values: `access_key_and_secret` ↓, `iam_role` ↓ |
required |
outputbucket |
string |
AWS S3 output bucket
A pre-existing bucket (folder optional) that AWS can use to store query results. ex: s3://polytomic-athena-results/customer-dataset |
required |
region |
string |
AWS region |
required |
#### `auth_mode`
When `auth_mode` is `access_key_and_secret`:
| Name | Type | Description | Required |
access_id |
string |
AWS access ID |
optional |
secret_access_key |
string |
AWS secret access key |
optional |
| Read-only property | Type | Description |
aws_user |
string |
User ARN |
```json
{
"name": "AWS Athena connection",
"type": "awsathena",
"configuration": {
"access_id": "AKIAIOSFODNN7EXAMPLE",
"auth_mode": "access_key_and_secret",
"outputbucket": "s3://polytomic-athena-results/customer-dataset",
"region": "us-east-1",
"secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
}
```
When `auth_mode` is `iam_role`:
| Name | Type | Description | Required |
external_id |
string |
External ID for the IAM role |
optional |
iam_role_arn |
string |
IAM role ARN |
required |
tags |
object |
Tags
Additional tags to apply during role assumption |
optional |
```json
{
"name": "AWS Athena connection",
"type": "awsathena",
"configuration": {
"auth_mode": "iam_role",
"external_id": "",
"iam_role_arn": "",
"outputbucket": "s3://polytomic-athena-results/customer-dataset",
"region": "us-east-1",
"tags": {}
}
}
```
## Model Sync
### Source
#### Configuration
| Name | Type | Description | Required |
catalog |
string |
Catalog |
optional |
database |
string |
Database |
optional |
query |
string |
|
optional |
table |
string |
Table |
optional |
#### Example
```json
{
...
"configuration": {
"catalog": "awsdatacatalog",
"database": "default",
"query": "SELECT * FROM \"webdata\".\"impressions\"",
"table": "users"
}
}
```
### Target
AWS Athena connections may be used as the destination in a model sync.
#### All targets
##### Configuration
| Name | Type | Description | Required |
created_column |
string |
'Created at' timestamp column |
optional |
preserve_table_on_resync |
boolean |
Preserve destination table when resyncing |
optional |
updated_column |
string |
'Updated at' timestamp column |
optional |
write_record_timestamps |
boolean |
Write row timestamp metadata |
optional |
##### Example
```json
{
...
"target": {
"configuration": {
"created_column": "",
"preserve_table_on_resync": false,
"updated_column": "",
"write_record_timestamps": false
}
}
}
```
### Target creation
AWS Athena connections may be used to create a new target for a model sync. The
following parameters are required to create a new target:
| NAME |
DESCRIPTION |
ENUM |
| name |
Table name |
false |
## Bulk Sync
### Source
AWS Athena connections may be used as a bulk sync source. No additional configuration options are required.
### Destination
#### Configuration
| Name | Type | Description | Required |
advanced |
object |
|
optional |
mirror_schemas |
boolean |
Indicates whether schemas should be mirrored |
optional |
schema |
string |
Output schema to write to |
optional |
#### Example
```json
{
...
"destination_configuration": {
"advanced": {
"table_prefix": "",
"truncate_existing": false
},
"mirror_schemas": false,
"schema": "public"
}
}
```
## Type handling
### Destination types
| POLYTOMIC TYPE | AWS ATHENA TYPE |
|-----------------------------|-----------------|
| `array<>` | `string` |
| `bigint` | `string` |
| `boolean` | `boolean` |
| `date` | `timestamp` |
| `datetime` | `timestamp` |
| `decimal(precision, scale)` | `string` |
| `double` | `string` |
| `int` | `string` |
| `json` | `string` |
| `jsonarray` | `string` |
| `number` | `string` |
| `object{}` | `string` |
| `single` | `string` |
| `smallint` | `string` |
| `string` | `string` |
| `time` | `timestamp` |
### Source types
| AWS ATHENA TYPE | POLYTOMIC TYPE |
|-----------------------------|-----------------------------|
| `ARRAY` | `jsonarray` |
| `BIGINT` | `bigint` |
| `BINARY` | `string` |
| `CHAR` | `string` |
| `DATE` | `date` |
| `DECIMAL` | `number` |
| `DECIMAL(precision, scale)` | `decimal(precision, scale)` |
| `DOUBLE` | `number` |
| `FLOAT` | `number` |
| `INT` | `int` |
| `INTEGER` | `int` |
| `INTERVAL DAY TO SECOND` | `string` |
| `INTERVAL YEAR TO MONTH` | `string` |
| `IPADDRESS` | `string` |
| `JSON` | `json` |
| `MAP` | `json` |
| `REAL` | `number` |
| `SMALLINT` | `smallint` |
| `STRING` | `string` |
| `TIME` | `time` |
| `TIME WITH TIME ZONE` | `time` |
| `TIMESTAMP` | `datetime` |
| `TIMESTAMP WITH TIME ZONE` | `datetime` |
| `TINYINT` | `smallint` |
| `VARBINARY` | `string` |
| `VARCHAR` | `string` |