The above solutions are good. But if you have more tables to delete, then running the "hive -e drop table" is slow. So, I used this:
hive -e 'use db; show tables' | grep pattern> file.hql
use the vim editor to open the .hql file and execute the commands below.
:% s! ^! drop table
:% S $ !;
then run
hive -f file.hql
This approach will be much faster.
Chandra
source share