Ready to get started?

Download a free trial of the Amazon Athena Driver to get started:

 Download Now

Learn more:

Amazon Athena Icon Amazon Athena JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with Amazon Athena.

Connect to Amazon Athena Data in as an External Source in Dremio



Use the CData JDBC Driver to connect to Amazon Athena as an External Source in Dremio.

The CData JDBC Driver for Amazon Athena implements JDBC Standards and allows various applications, including Dremio, to work with live Amazon Athena data. Dremio is a data lakehouse platform designed to empower self-service, interactive analytics on the data lake. With the CData JDBC Driver, you can include live Amazon Athena data as a part of your enterprise data lake. This article describes how to connect to Amazon Athena data from Dremio as an External Source.

The CData JDBC Driver enables high-speed access to live Amazon Athena data in Dremio. Once you install the driver, authenticate with Amazon Athena and gain immediate access to Amazon Athena data within your data lake. By surfacing Amazon Athena data using native data types and handling complex filters, aggregations, & other operations automatically, the CData JDBC Driver grants seamless access to Amazon Athena data.

Build the ARP Connector

To use the CData JDBC Driver in Dremio, you need to build an Advanced Relation Pushdown (ARP) Connector. You can view the source code for the Connector on GitHub or download the ZIP file (GitHub.com) directly. Once you copy or extract the files, run the following command from the root directory of the connector (the directory containing the pom.xml file) to build the connector.

mvn clean install

Once the JAR file for the connector is built (in the target directory), you are ready to copy the ARP connector and JDBC Driver to your Dremio instance.

Installing the Connector and JDBC Driver

Install the ARP Connector to %DREMIO_HOME%/jars/ and the JDBC Driver for Amazon Athena to %DREMIO_HOME%/jars/3rdparty. You can use commands similar to the following:

ARP Connector

docker cp PATH\TO\dremio-amazonathena-plugin-20.0.0.jar dremio_image_name:/opt/dremio/jars/

JDBC Driver for Amazon Athena

docker cp PATH\TO\cdata.jdbc.amazonathena.jar dremio_image_name:/opt/dremio/jars/3rdparty/

Connecting to Amazon Athena

Amazon Athena will now appear as an External Source option in Dremio. The ARP Connector built uses a JDBC URL to connect to Amazon Athena data. The JDBC Driver has a built-in connection string designer that you can use (see below).

Built-in Connection String Designer

For assistance in constructing the JDBC URL, use the connection string designer built into the Amazon Athena JDBC Driver. Double-click the JAR file or execute the jar file from the command line.

java -jar cdata.jdbc.amazonathena.jar

Fill in the connection properties and copy the connection string to the clipboard.

Authenticating to Amazon Athena

To authorize Amazon Athena requests, provide the credentials for an administrator account or for an IAM user with custom permissions: Set AccessKey to the access key Id. Set SecretKey to the secret access key.

Note: Though you can connect as the AWS account administrator, it is recommended to use IAM user credentials to access AWS services.

Obtaining the Access Key

To obtain the credentials for an IAM user, follow the steps below:

  1. Sign into the IAM console.
  2. In the navigation pane, select Users.
  3. To create or manage the access keys for a user, select the user and then select the Security Credentials tab.

To obtain the credentials for your AWS root account, follow the steps below:

  1. Sign into the AWS Management console with the credentials for your root account.
  2. Select your account name or number and select My Security Credentials in the menu that is displayed.
  3. Click Continue to Security Credentials and expand the Access Keys section to manage or create root account access keys.

Authenticating from an EC2 Instance

If you are using the CData Data Provider for Amazon Athena 2018 from an EC2 Instance and have an IAM Role assigned to the instance, you can use the IAM Role to authenticate. To do so, set UseEC2Roles to true and leave AccessKey and SecretKey empty. The CData Data Provider for Amazon Athena 2018 will automatically obtain your IAM Role credentials and authenticate with them.

Authenticating as an AWS Role

In many situations it may be preferable to use an IAM role for authentication instead of the direct security credentials of an AWS root user. An AWS role may be used instead by specifying the RoleARN. This will cause the CData Data Provider for Amazon Athena 2018 to attempt to retrieve credentials for the specified role. If you are connecting to AWS (instead of already being connected such as on an EC2 instance), you must additionally specify the AccessKey and SecretKey of an IAM user to assume the role for. Roles may not be used when specifying the AccessKey and SecretKey of an AWS root user.

Authenticating with MFA

For users and roles that require Multi-factor Authentication, specify the MFASerialNumber and MFAToken connection properties. This will cause the CData Data Provider for Amazon Athena 2018 to submit the MFA credentials in a request to retrieve temporary authentication credentials. Note that the duration of the temporary credentials may be controlled via the TemporaryTokenDuration (default 3600 seconds).

Connecting to Amazon Athena

In addition to the AccessKey and SecretKey properties, specify Database, S3StagingDirectory and Region. Set Region to the region where your Amazon Athena data is hosted. Set S3StagingDirectory to a folder in S3 where you would like to store the results of queries.

If Database is not set in the connection, the data provider connects to the default database set in Amazon Athena.

NOTE: To use the JDBC Driver in Dremio, you will need a license (full or trial) and a Runtime Key (RTK). For more information on obtaining this license (or a trial), contact our sales team.

Add the Runtime Key (RTK) to the JDBC URL. You will end up with a JDBC URL similar to the following:

jdbc:amazonathena:RTK=5246...;AccessKey='a123';SecretKey='s123';Region='IRELAND';Database='sampledb';S3StagingDirectory='s3://bucket/staging/';

Access Amazon Athena as an External Source

To add Amazon Athena as an External Source, click to add a new source and select AmazonAthena. Copy the JDBC URL and paste it into the New AmazonAthena Source wizard.

Save the connection and you are ready to query live Amazon Athena data in Dremio, easily incorporating Amazon Athena data into your data lake.

More Information & Free Trial

Using the CData JDBC Driver for Amazon Athena in Dremio, you can incorporate live Amazon Athena data into your data lake. Check out our CData JDBC Driver for Amazon Athena page for more information about connecting to Amazon Athena. Download a free, 30 day trial of the CData JDBC Driver for Amazon Athena and get started today.