Hive2 导入导出
2019独角兽企业重金招聘Python工程师标准>>>
一、导出
1.导入到本地文件系统中
hive> show tables;
OK
location
temperature
windspeed
Time taken: 0.679 seconds, Fetched: 3 row(s)
hive> insert overwrite local directory '/home/hadoop/data' > select * from location;
...
...
...
[hadoop@hftclclw0001 data]$ pwd
/home/hadoop/data
[hadoop@hftclclw0001 data]$ ll
total 4
-rw-r--r-- 1 hadoop root 113 Oct 27 09:05 000000_0
[hadoop@hftclclw0001 data]$ cat 000000_0
Adelaide6769
Clean_Air900
Faraday6564
Grytviken5436
Halley7526
Neumayer708
Rothera6768
Signy6045
2.导出到HDFS中
hive> show tables;
OK
location
temperature
windspeed
Time taken: 0.679 seconds, Fetched: 3 row(s)
hive> insert overwrite directory '/user/user01/data' > select * from location;
...
...
...
3.导出到Hive中的另一张表中
二、导入
转载于//my.oschina.net/u/204498/blog/522743
还没有评论,来说两句吧...