hive导出数据
来源:互联网 发布:中国m2历年数据增速 编辑:程序博客网 时间:2024/05/17 13:42
导出的方式
1.hadoop命令的方式,get、text
hive> select * from student2;OKxiaoming 10xiaohong 12xiaoli 13xiaowang 11lucy 21lily 22Time taken: 1.064 seconds, Fetched: 6 row(s)hive> desc formatted student2;OK# col_name data_type comment name string age int # Detailed Table Information Database: default Owner: root CreateTime: Thu Aug 18 19:51:17 CST 2016 LastAccessTime: UNKNOWN Protect Mode: None Retention: 0 Location: hdfs://ubuntu:9000/user/hive/warehouse/data Table Type: MANAGED_TABLE Table Parameters: COLUMN_STATS_ACCURATE false numFiles 0 numRows -1 rawDataSize -1 totalSize 0 transient_lastDdlTime 1471521331 # Storage Information SerDe Library: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe InputFormat: org.apache.hadoop.mapred.TextInputFormat OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat Compressed: No Num Buckets: -1 Bucket Columns: [] Sort Columns: [] Storage Desc Params: field.delim \t line.delim \n serialization.format \t Time taken: 4.132 seconds, Fetched: 34 row(s)root@ubuntu:~# lsa.c bea Oracle svn test.txtroot@ubuntu:~# hadoop fs -get hdfs://ubuntu:9000/user/hive/warehouse/data/student2.txt student.txtroot@ubuntu:~# lsa.c bea Oracle student.txt svn test.txtroot@ubuntu:~# cat student.txt lucy 21lily 22root@ubuntu:~# hadoop fs -texthdfs://ubuntu:9000/user/hive/warehouse/data/student2.txt > student.txt
2.通过insert……directory 方式
inset overwrite [local] directory '/root/data' [row format delinited fields terminated by '\t'] select name,age from student;
local情况下才能使用row format
3.shell命令加管道:
hive -f/e |sed/grep/awk >file
root@ubuntu:/app/bigdata/hive-0.13.0/bin# ./hive -e "select * from student2"16/08/19 18:44:39 WARN conf.HiveConf: DEPRECATED: hive.metastore.ds.retry.* no longer has any effect. Use hive.hmshandler.retry.* insteadLogging initialized using configuration in jar:file:/app/bigdata/hive-0.13.0/lib/hive-common-0.13.0.jar!/hive-log4j.propertiesOKxiaoming 10xiaohong 12xiaoli 13xiaowang 11lucy 21lily 22Time taken: 1.143 seconds, Fetched: 6 row(s)root@ubuntu:/app/bigdata/hive-0.13.0/bin# ./hive -S -e "select * from student2" 16/08/19 18:44:57 WARN conf.HiveConf: DEPRECATED: hive.metastore.ds.retry.* no longer has any effect. Use hive.hmshandler.retry.* insteadxiaoming 10xiaohong 12xiaoli 13xiaowang 11lucy 21lily 22
4.第三方工具,sqoop
0 0
- hive数据导出
- Hive 导入导出数据
- hive数据导出
- hive数据导入导出
- Hive数据导出
- hive 导入导出数据
- hive数据导出
- 04-Hive数据导出
- hive导出数据
- hive导入导出数据
- hive导出hbase数据
- hive导入/导出数据
- Hive笔记七:Hive的数据导出
- Hive数据导入和导出
- hive导入和导出数据
- hive 导出数据分隔符
- Hive数据导入和导出
- (7-12)hive导出数据
- Effective C++笔记(4)—条款5/6分析
- caffe 实战系列:proto文件格式以及含义解析:如何定义网络,如何设置网络参数(以AlexNet为例)
- web容器
- 自定义promise
- POJ 3180 The Cow Prom(Tarjan Algorithm求强连通子集)
- hive导出数据
- hdu5858Hard problem+计算几何(圆的面积交)
- AssetBundle5.0 打包,下载到本地,加载
- C++学习-C++简介2
- ACM--模拟--Inna and Choose Options--水
- 百度插件ueditor
- Jquery搜索框效果(百度关键词联想)
- 网络解析多接口
- 集合操作 异常处理