How to delete / drop multiple tables in AWS athena?

0 votes
I cannot run multiple DROP queries at same time. I am trying to drop few tables from Athena. Is there a way to do it? Can anyone help me in this?

Thank you in advance.
Jan 17 in AWS by Anjali
• 2,910 points
181 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

It is not possible to run multiple queries in the one request. This is not supported by Athena as of now.

An alternative is to create the tables in a specific database. Dropping the database will then delete all the tables.

CREATE DATABASE db1;
CREATE EXTERNAL TABLE table1 ...;
CREATE EXTERNAL TABLE table2 ...;
DROP DATABASE db1 CASCADE;

The DROP DATABASE command will delete the table1 and table2 tables. This is not the preffered method as it may delete the tables you dont want to delete.

Hope this helps you.

answered Jan 17 by Edureka
• 4,180 points

Related Questions In AWS

+1 vote
1 answer
0 votes
1 answer

How to skip headers when reading a CSV file in S3 and creating a table in AWS Athena?

This is a known deficiency. The best ...READ MORE

answered Sep 4, 2018 in AWS by Archana
• 3,770 points
471 views
0 votes
1 answer

How to set Multiple locations in Athena?

Unfortunately you can use athena with just ...READ MORE

answered Jan 16 in AWS by william
50 views
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

How can I create tables in Athena?

Creating tables in Athena is very easy. ...READ MORE

answered Jan 17 in AWS by Edureka
• 4,180 points
16 views
0 votes
1 answer

How to update or insert data using Athena?

Athena is a query language and as ...READ MORE

answered Jan 17 in AWS by Edureka
• 4,180 points
48 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.