Have a multi level partitioned Hive table,now need to delete the partitioned folders which are older than certain years.
Multilevel partitions looks as below.
/data/warehouse/suite/catalyst/site/company=abc/year=2019/month=08
/data/warehouse/suite/catalyst/site/company=cde/year=2018/month=05
/data/warehouse/suite/catalyst/site/company=cde/year=2017/month=11
/data/warehouse/suite/catalyst/site/company=cde/year=2016/month=11
If want to delete the partitions older than 2 years, That means /year=2017/month=11 and year=2016/month=11 need to be deleted How it can be done.
Pls help, Thanks in advance.