Is there a Command line tool to access Amazon Athena?

0 votes
I am looking for a command line tool so that I can make queries to Amazon Athena. It should work with JDBC, using the driver com.amazonaws.athena.jdbc.AthenaDriver,

but I haven't found any command line tool that works with it. Can someone help me with this?
Jan 16 in AWS by Anjali
• 2,910 points
106 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The AWS command line tool supports Amazon Athena operations.

1. Attach the AmazonAthenaFullAccess policy to the IAM role of the calling user.

Then, to get started querying, you will use the start-query-execution command as follows:

aws athena start-query-execution 
    --query-string "SELECT * FROM MyDb.MyTable" 
    --result-configuration "OutputLocation"="s3://MyBucket/logs" [Optional: EncryptionConfiguration]
    --region <region>

This will return a JSON object of the QueryExecutionId, which can be used to retrieve the query results using the following command:

aws athena get-query-results
    --query-execution-id <id>
    --region <region>

Which also returns a JSON object of the results and metadata.

More information can be found in the official AWS Documentation.

Hope this helps!

answered Jan 16 by rishab

Related Questions In AWS

0 votes
2 answers

How to configure Amazon EC2 command line interface?

You can use this command to create ...READ MORE

answered Feb 23 in AWS by Shashank
• 1,350 points
52 views
+1 vote
2 answers

Is there a API to get AWS Marketplace Products

AWS Marketplace Entitlement Service API Reference The AWS ...READ MORE

answered Aug 1, 2018 in AWS by findingbugs
• 4,730 points
44 views
+3 votes
5 answers

How to move files from amazon ec2 to s3 bucket using command line

First Option sm3cmd Use s3cmd s3cmd get s3://AWS_S3_Bucket/dir/file Take a ...READ MORE

answered Aug 29, 2018 in AWS by Priyaj
• 56,120 points
818 views
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

Is it possible to add a compatibility layer above AWS?

Well there are few tools like TyphoonAE ...READ MORE

answered Jan 14 in AWS by Archana
• 5,360 points
12 views
0 votes
1 answer

How to store Amazon Athena Query Results into new Table?

This is not supported by Athena as Amazon ...READ MORE

answered Jan 16 in AWS by heena
120 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.