Hive写sql脚本删除指定表

Hive写sql脚本删除指定表,第1张

Hive写sql脚本删除指定

脚本:drop_all_table.sql

drop table to_client_song_play_operate_req_d;
drop table to_song_info_d;
drop table tw_singer_rsi_d;
drop table tw_song_baseinfo_d;
drop table tw_song_ftur_d;
drop table tw_song_rsi_d;

执行脚本

[root@node4 ~]# hive -f ./drop_all_table.sql 

Logging initialized using configuration in jar:file:/opt/hive-1.2.1/lib/hive-common-1.2.1.jar!/hive-log4j.properties
OK
Time taken: 3.101 seconds
OK
Time taken: 0.185 seconds
OK
Time taken: 0.313 seconds
OK
Time taken: 0.35 seconds
OK
Time taken: 0.302 seconds
OK
Time taken: 0.386 seconds

查看对比

hive> show tables;
OK
browser
event_logs
hbasetbl
stats_view_depth
stats_view_depth_tmp
tmp_order
to_client_song_play_operate_req_d
to_song_info_d
tw_singer_rsi_d
tw_song_baseinfo_d
tw_song_ftur_d
tw_song_rsi_d
Time taken: 0.054 seconds, Fetched: 12 row(s)
hive> select * from TW_SONG_baseINFO_D limit 10;
FAILED: SemanticException [Error 10001]: Line 1:14 Table not found 'TW_SONG_baseINFO_D'
hive> show tables;
OK
browser
event_logs
hbasetbl
stats_view_depth
stats_view_depth_tmp
tmp_order
Time taken: 0.033 seconds, Fetched: 6 row(s)

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5679356.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存