Skip to main content Skip to complementary content
  • New archived content: Talend MDM, Talend Data Catalog 8.0, and Talend 7.3 products reached their end of life in 2024. Their documentation was moved to the Talend Archive page and will no longer receive content updates.
Close announcements banner

Using the JDBC connector to connect to Amazon Athena

This example shows how to use the Java JDBC driver to connect to the Amazon Athena service and leverage Amazon Athena service in Talend Studio.

Setting up a JDBC connection to connect to Amazon Athena

Before you begin

  • Amazon Athena is currently available only in selected AWS regions. Verify the availability of the service from AWS global infrastructure region table.
  • You have the required additional library AthenaJDBC42-2.X.X.jar ready. If not, download the Athena JDBC driver here.
  • As the query results from Amazon Athena needs to be saved to Amazon S3, create an S3 output folder. For more information on Amazon Athena, Amazon S3, and JDBC, see:

Procedure

  1. In the Repository tree view of Talend Studio, expand the Metadata node, right-click Db Connections and select Create connection.
    Screenshot of the Repository tree view.
    The Database connection wizard opens.
  2. Provide the connection name and purpose and click Next.
  3. From the DB Type list, select JDBC.
  4. In the JDBC URL field, provide the JDBC URL details, including your AWS user ID and password.
    jdbc:awsathena://AwsRegion=<AWS Region>;User=<AWS Access Key>;Password=<AWS Secret Key>;S3OutputLocation=<S3 folder>
  5. Install the required additional library.
    1. In the Drivers table, click the [+] button to add a line and click the [...] button to open the Module dialog box.
    2. Select the Install a new module option, click the [...] button to browse to the downloaded jar.
      Screenshot of the Module dialog box.
    3. Click OK to close the dialog box.
  6. Back in the Database connection wizard, click the Select class name button and select the main class of the driver allowing to communicate with Amazon Athena.
  7. Fill in your database user authentication data in the User Id and Password fields.
    Screenshot of the Database connection wizard.
  8. Click Test connection and then Finish to close the wizard.
  9. In the Repository tree view, right-click the JDBC connection you just created and select Retrieve Schema to retrieve table schema of the connected Amazon Athena service.
    Screenshot of the Repository tree view.

Setting up a Job to connect to Amazon Athena

Procedure

  1. Create a Talend standard Job, place two components to its design workspace: a tDBInput and a tLogRow, and label them based on your needs.
  2. Double-click the tDBInput component, select JDBC from the Database list, and click Apply.
  3. Connect the tDBInput and tLogRow components using a Row > Main connection.
    Screenshot of the Job in the Designer.
  4. In the Repository tree view, expand the JDBC connection you just created, select the table schema of interest, and place it onto the tDBInput component.
    The connection information, table name, and schema are automatically set.
  5. Click Guess Query to generate the query clause, and edit it based on your needs.
  6. In the Basic settings view of the tLogRow component, click Sync columns to make sure it has the identical schema with the input components, and select the Table (each is key/value list) option for better readability of the console display.
  7. Press F6 to run your Job.

Results

The Run console displays the data read from the Amazon Athena service.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!