标签:
[hive@vm1 ~]$ more a.csv
‘1‘,‘zhangsan‘,‘20‘,‘beijing,shanghai,shandong‘,1
‘2‘,‘lisi‘,‘22‘,‘guangdong,hainan‘,1
‘3‘,‘wangwu‘,‘23‘,‘shandong,jiangsu,xizang‘,0
add jar /xx/yy/zz.jar;
create table t_csv(id int, name string, address string, sex tinyint) row format serde ‘org.apache.hadoop.hive.serde2.OpenCSVSerde‘ with serdeproperties("separatorChar"=",","quoteChar"="‘","escapeChar"= "\\") stored as textfile;
load data local inpath ‘${env:HOME}/a.csv‘ into table t_csv;
select name, address from t_csv;
标签:
原文地址:http://www.cnblogs.com/lishouguang/p/4560815.html