Athena
Connect & Ingest data from / to AWS Athena
AWS Athena is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL. Athena is serverless, so there is no infrastructure to manage, and you pay only for the queries that you run. See https://aws.amazon.com/athena/ for more details.
Setup
The following credentials keys are accepted:
data_location(required) -> S3 Bucket location for table data storage. e.g.s3://athena-bucket/datastaging_location(required) -> S3 Bucket location for temporary data and results. e.g.s3://athena-bucket-staging/tempaws_region(required) -> AWS region where your Athena workgroup is located (e.g.,us-east-1,eu-west-1).aws_access_key_id(optional) -> AWS access key ID. Can also be provided viaAWS_ACCESS_KEY_IDenvironment variable.aws_secret_access_key(optional) -> AWS secret access key. Can also be provided viaAWS_SECRET_ACCESS_KEYenvironment variable.aws_session_token(optional) -> AWS session token for temporary credentials. Can also be provided viaAWS_SESSION_TOKENenvironment variable.aws_profile(optional) -> AWS profile name from your credentials file to use for authentication.workgroup(optional) -> Athena workgroup to use. Default isprimary.catalog(optional) -> Data catalog to use. Default isAwsDataCatalog.database(optional) -> Default database/schema to use for queries.
Authentication Methods
Athena supports multiple authentication methods:
Static Credentials: Provide
access_key_idandsecret_access_keyAWS Profile: Specify a
profilename from your AWS credentials fileDefault Credential Chain: Uses environment variables, IAM roles, or credential files automatically
Temporary Credentials: Use
session_tokenalong with access keys for temporary access
Using sling conns
sling connsHere are examples of setting a connection named ATHENA. We must provide the type=athena property:
Environment Variable
Sling Env File YAML
See here to learn more about the sling env.yaml file.
Bulk Operations
For optimal performance with large datasets, Sling can leverage Athena's UNLOAD functionality and S3 integration:
Set
staging_locationproperty to enable S3-based bulk operationsAthena will use the UNLOAD command to export data to S3, then read from there
For imports, data is staged in S3 before being loaded into Athena tables
Common Usage Examples
Basic Operations
Data Import/Export
If you are facing issues connecting, please reach out to us at [email protected], on discord or open a Github Issue here.
Last updated
Was this helpful?