Hive2 导入导出

比眉伴天荒 2022-01-15 01:31 368阅读 0赞

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

一、导出

1.导入到本地文件系统中

  1. hive> show tables;
  2. OK
  3. location
  4. temperature
  5. windspeed
  6. Time taken: 0.679 seconds, Fetched: 3 row(s)
  7. hive> insert overwrite local directory '/home/hadoop/data' > select * from location;
  8. ...
  9. ...
  10. ...
  11. [hadoop@hftclclw0001 data]$ pwd
  12. /home/hadoop/data
  13. [hadoop@hftclclw0001 data]$ ll
  14. total 4
  15. -rw-r--r-- 1 hadoop root 113 Oct 27 09:05 000000_0
  16. [hadoop@hftclclw0001 data]$ cat 000000_0
  17. Adelaide6769
  18. Clean_Air900
  19. Faraday6564
  20. Grytviken5436
  21. Halley7526
  22. Neumayer708
  23. Rothera6768
  24. Signy6045

2.导出到HDFS中

  1. hive> show tables;
  2. OK
  3. location
  4. temperature
  5. windspeed
  6. Time taken: 0.679 seconds, Fetched: 3 row(s)
  7. hive> insert overwrite directory '/user/user01/data' > select * from location;
  8. ...
  9. ...
  10. ...

3.导出到Hive中的另一张表中

二、导入

转载于:https://my.oschina.net/u/204498/blog/522743

发表评论

表情:
评论列表 (有 0 条评论,368人围观)

还没有评论,来说两句吧...

相关阅读