We are proud to share our inclusion in the 2024 Gartner Magic Quadrant for Data Integration Tools. We believe this recognition reflects the differentiated business outcomes CData delivers to our customers.
Get the Report →Connect to Amazon Athena Data 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.
About Amazon Athena Data Integration
CData provides the easiest way to access and integrate live data from Amazon Athena. Customers use CData connectivity to:
- Authenticate securely using a variety of methods, including IAM credentials, access keys, and Instance Profiles, catering to diverse security needs and simplifying the authentication process.
- Streamline their setup and quickly resolve issue with detailed error messaging.
- Enhance performance and minimize strain on client resources with server-side query execution.
Users frequently integrate Athena with analytics tools like Tableau, Power BI, and Excel for in-depth analytics from their preferred tools.
To learn more about unique Amazon Athena use cases with CData, check out our blog post: https://www.cdata.com/blog/amazon-athena-use-cases.
Getting Started
Prerequisites
This article assumes you are utilizing Docker to run Dremio. You can create a Docker container with the Dremio service using a command similar to the follow:
docker run -d --name dremio -p 9047:9047 -p 31010:31010 dremio/dremio-oss
Where dremio is the name of the container, 9047 is the container's port for the Dremio web interface and 31010 is the port that maps to the Dremio query service. dremio/dremio-oss specifies the image to use.
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
NOTE: The CData ARP Connectors are build to be compiled with Java 11. Be sure to install Java 11 and use the correct version. You can update your Java version using a command similar to the following:
sudo update-alternatives --config java
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-{DREMIO_VERSION}.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:
- Sign into the IAM console.
- In the navigation pane, select Users.
- 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:
- Sign into the AWS Management console with the credentials for your root account.
- Select your account name or number and select My Security Credentials in the menu that is displayed.
- 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...;AWSAccessKey='a123';AWSSecretKey='s123';AWSRegion='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.