下面介绍一下hive 导出的几种方式
- 本地文件直接导出
insert overwrite local directory '/data/hive/export/student_info' select * from default.student
- 修改分隔符和换行符
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
- shell 脚本导出
bin/hive -e "select * from default.student_info ;" > /data/hive/export/local/student_info
- 导出数据到文件系统
insert overwrite directory '/data/hive/export/student_info' select * from default.student
- export 方法
export table student_info partition (country="china") to "/data/hive/export/"
欢迎关注,更多福利

本文详细介绍了Hive中多种数据导出方法,包括直接导出到本地文件、修改分隔符和换行符、使用shell脚本导出、导出到文件系统以及使用export方法。每种方法都有其特定的适用场景和优势。

2439

被折叠的 条评论
为什么被折叠?



