[hadoop] How to delete/truncate tables from Hadoop-Hive?

Please tell me how to delete table from hive and also tell from where i can get more information about hive queries.

This question is related to hadoop hive

The answer is


To Truncate:

hive -e "TRUNCATE TABLE IF EXISTS $tablename"

To Drop:

hive -e "Drop TABLE IF EXISTS $tablename"

Use the following to delete all the tables in a linux environment.

hive -e 'show tables' | xargs -I '{}' hive -e 'drop table {}'

You need to drop the table and then recreate it and then load it again