您的位置:首页 > 其它

hive应用实例 将查询结果写入原表中

2016-03-16 16:03 337 查看
实例:

hive> select * from zzz;
OK
leilei    18
lucy    19
xiaoqi    20
xxxx    21
yyyy    22

hive> insert overwrite table zzz
    > select * from zzz
    > where age >20;

hive客户端输出的一部分内容:

Moving data to: hdfs://mycluster/tmp/hive_2016-03-09_16-12-49_926_6149466147350809570-1/-ext-10000
Loading data to table temp.zzz
Moved: 'hdfs://mycluster/tmp/test/person' to trash at: hdfs://mycluster/user/.Trash/Current

应该是先把查询结果保存,再把先前的内容干掉。

hive> select * from zzz;
OK
xxxx    21
yyyy    22
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: