Skip to content

How do I drop native Delta tables from Athena catalog?

3

Onboarded native Delta table using

CREATE EXTERNAL TABLE [table_name]
LOCATION '[s3_location]'
TBLPROPERTIES (
'table_type'='DELTA'
);

Works great when I query it. However, when I run

drop table [table_name]

I get the following error:

"Routed statement type 'DROP_TABLE' to DeltaLakeDDLEngine, expected to route to DATACATALOG_DDL_ENGINE"

asked 4 years ago2.6K views

3 Answers
2

Deleting from the Glue UI or using Glue API works

answered 4 years ago

AWS
EXPERT

reviewed 4 years ago

  • see the documentation to review the DDL support: https://docs.aws.amazon.com/athena/latest/ug/delta-lake-tables.html

  • @fabrizio this answer is okay as a manual workaround, but I have workloads that rely on the athena API only. There is no feasible way for me to change the underlying code so your workaround is no good for my use case.

    Is there any way to raise this issue with the AWS team? The specific ask is "support dropping delta tables from athena via SQL command". Thanks

0

Is it possible to re-open the issue? The workaround using the glue ui to drop the table doesn't solve the issue. From the documentation create and drop table should work directly from athena (https://docs.aws.amazon.com/athena/latest/ug/delta-lake-tables.html):![Enter image description here](/media/postImages/original/IM4Wyu2hqUTzilmHyHAirJEw)

answered 3 years ago

0

We are facing a similar issue when dropping a Delta Lake table in Athena

DROP TABLE not supported for Delta Lake This query ran against the ‘111’ database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query ID: 111

We are seeking assistance in understanding the peculiarities of managing Delta Lake tables via Athena. Any insights or guidance would be greatly appreciated.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.