Please tell me how to delete table from hive and also tell from where i can get more information about hive queries.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use drop command to delete meta data and actual data from HDFS.
And just to delete data and keep the table structure, use truncate command.
For further help regarding hive ql, check language manual of hive.
回答2:
Use the following to delete all the tables in a linux environment.
hive -e 'show tables' | xargs -I '{}' hive -e 'drop table {}'
回答3:
To Truncate:
hive -e "TRUNCATE TABLE IF EXISTS $tablename"
To Drop:
hive -e "Drop TABLE IF EXISTS $tablename"
回答4:
You need to drop the table and then recreate it and then load it again