1、创建表
CREATE TABLE t_user (
id INT,
username STRING,
password STRING
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES ("separatorChar"=",", "quotechar"="\"")
STORED AS TEXTFILE;
2、导入数据
LOAD DATA INPATH '/data/user.csv' OVERWRITE INTO TABLE t_user;