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
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞