'RJDBC' based 'DBI' driver to Amazon Athena, which is an interactive query service to analyze data in Amazon 'S3' using standard 'SQL'.
Or you can easily install the most recent development version of the R package as well:
This provides a simplified DBI driver for Athena:
require(DBI)con <- dbConnect(AWR.Athena::Athena(), region='us-west-2', S3OutputLocation='s3://nfultz-athena-staging', Schema='default')dbListTables(con)dbGetQuery(con, "Select count(*) from sampledb.elb_logs")
Installing and loading the JDBC driver package is handled automatically.
Most database functionality is actually provided by RJDBC, but if you have Athena-specific features in mind, please open a ticket on the feature request, or even better, submit a pull request :)
To be able to use this package, you need to have an AWS account. If you do not have one already, you can register for free at Amazon although usage is currently $5 / terabyte scanned.
Once you have an AWS account, make sure your default AWS Credentials are available via the DefaultAWSCredentialsProviderChain .
In short, you either provide a default credential profiles file at
~/.aws/credentials, use the
AWS_SECRET_ACCESS_KEY environment variables; or if using
AWR.Athena on AWS, you can also rely on the EC2 instance profile credentials
or ECS Task Role as well.