您的位置:首页 > 其它

Hive2 导入导出

2015-10-27 00:00 169 查看
一、导出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中的另一张表中
二、导入
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: