csv文件数据导入到hive操作说明

csv文件数据导入到hive操作说明
1.创建测试表
create table csv_t1(a string,b string,c string)
row format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
with serdeproperties ("separatorChar"=",")  
stored as textfile;

或者:
create table csv_t1(a string,b string)
row format delimited
fields terminated by ','
stored as textfile

2.利用hue 文件浏览器,上传本地csv文件:假设路径为/tmp/hive,  文件名为: test2017.csv

3.执行数据加载命令:
load data inpath '/tmp/hive/test2017.csv'  overwrite into table pabrdm.csv_t1;

4.查看结果数据
select * from csv_t1;

你可能感兴趣的:(Hive)