AWS Athena: Delete partitions between date range


I have an athena table with partition based on date like this:

I want to delete all the partitions that are created last year.

I tried the below query, but it didnt work.


According to, ALTER TABLE tblname DROP PARTITION takes a partition spec, so no ranges are allowed.

In Presto you would do DELETE FROM tblname WHERE ..., but DELETE is not supported by Athena either.

For these reasons, you need to do leverage some external solution.

For example:

  1. list the files as in
  2. delete the files and containing directories
  3. update partitions information ( should be helpful)

Leave a Reply