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
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
相关文章推荐
- Linux笔记(47)——shell运算符
- Java 对密码MD5
- 使用java 将 Spark RDD和DataFrame转换
- 排序算法的概述
- IOS之返回指定页面
- Swift - 正则表达式的几种使用方式
- 题目28:Implement strStr()
- input checkbox 复选框的操作示例
- salesforce 零基础开发入门学习(三)sObject简单介绍以及简单DML操作(SOQL)
- freemaker获取字符串长度
- poj 3207 Ikki's Story IV - Panda's Trick 2-SAT
- 源程序管理软件与项目管理软件
- 词频统计
- C# DataTable转实体 通用方法
- greenDao学习
- iOS中XIB与代码结合设置控件
- 设计模式中的模板方法模式在Ruby中的应用实例两则
- MOV转MP4格式
- Spark Standalone模式下操作有kerberos保护的Hbase时出现挂死的问题
- iOS获取通讯录功能