Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to arhive hive external tables?

How to arhive hive external tables?

New Contributor

Hi Guys,

Is there a way to check hive external tables which are created N days before and drop those tables along with underlying hdfs data. Can this be achieved in unix script?

1 REPLY 1

Re: How to arhive hive external tables?

Super Guru

@Rohit Sinha

We can run

Desc formatted <db_name>.<tab_name>;

then extract CreateTime value in your shell script, to get when was the table is created and then make a decision to drop the table (or) not.

If you have external table then follow this way to drop the table with hdfs data.

Don't have an account?
Coming from Hortonworks? Activate your account here