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,900 points
432 views

1 answer to this question.

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
2 answers

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

Thanks for the answer. This should be clear ...READ MORE

answered Aug 14 in AWS by athenauserz
937 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
148 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
28 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
266 views