Skip to content

Connecting PyCharm to AWS Athena

Prerequisite: You have completed all the steps to Remote Development Guide; you have access to your AWS Credentials.

What is AWS Athena?

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.

How to Connect to AWS Athena

  1. Select Database tool

    Step 1

  2. Select + button, and click on Driver

    Step 2

  3. Scroll down to Athena , select whatever link is next to Athena to download the driver, select Apply then OK on bottom of dialog box.

    Step 3

  4. Select + again, this time hover over Data Source , hover down to Other , in the pop-out box over down to AWS Athena and select it.

    Step 4

  5. In the dialog box, you’ll need to create a unique jdbc URL. Follow the instructions below:

    1. Enter your AWS Access Key in the User box
    2. Enter your Secret Key in the Password box
    3. The unique jdbc URL will take the following form, simply replace with the bucket you are looking to query jdbc:awsathena://AwsRegion=us-west-2;S3OutputLocation=s3://<bucket name>

    Step 5

  6. You’ll know you’re successful when the tables populate within the Database as below

    Step 6

Querying Athena from PyCharm

After successfully connecting to Athena, simply right click on the table you’d like to query, hover over + New , in the pop-out box hover over and select Query Console. Then begin your queries.

Query Image