Hive2 导入导出

一、导出

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中的另一张表中


二、导入

你可能感兴趣的:(Hive2 导入导出)