实例:
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