Excel数据导入hive步骤


1. Excel导出逗号文件.csv

2. 将CSV文件导入到hive服务器制定目录

3. 转换编码格式

转换编码格式,在指定目录下执行如下命令:piconv -f gb2312 -t UTF-8 CompanyCode.txt  >  c.txt

4. 在hive中建表

create table sf_staff_info(

uid string,

department string,

phone string

)

ROW format delimited

fields terminated by ','

STORED AS TEXTFILE;

5. 加载数据到hive表中

load data local inpath '/home/rd/xiang/sf_staff_info.csv' into table sf_staff_info;

   
转自:https://www.jianshu.com/p/209827ba4335 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM