0
点赞
收藏
分享

微信扫一扫

导出hive表数据的5种方法

下面介绍一下hive 导出的几种方式

  1. 本地文件直接导出

insert overwrite local directory '/data/hive/export/student_info' select * from default.student

2.修改分隔符和换行符

insert overwrite local directory '/data/hive/export/student_info' 
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' COLLECTION ITEMS TERMINATED BY '\n'
select * from default.student

3.shell 脚本导出

bin/hive -e "select * from default.student_info ;" > /data/hive/export/local/student_info

4.导出数据到文件系统

insert overwrite directory '/data/hive/export/student_info' select * from default.student

5.export 方法

export table student_info partition (country="china") to "/data/hive/export/"

  • 1
  • 2
举报

相关推荐

0 条评论