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
-
Select Database tool
-
Select
+
button, and click onDriver
-
Scroll down to
Athena
, select whatever link is next to Athena to download the driver, selectApply
thenOK
on bottom of dialog box. -
Select
+
again, this time hover overData Source
, hover down toOther
, in the pop-out box over down toAWS Athena
and select it. -
In the dialog box, you’ll need to create a unique
jdbc
URL. Follow the instructions below:- Enter your
AWS Access Key
in theUser
box - Enter your
Secret Key
in thePassword
box - The unique
jdbc
URL will take the following form, simply replacewith the bucket you are looking to query jdbc:awsathena://AwsRegion=us-west-2;S3OutputLocation=s3://<bucket name>
- Enter your
-
You’ll know you’re successful when the tables populate within the
Database
as below
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.