hive用SERDE解析带引号的数据

文本数据格式如:

"100000006","101"

使用SERDE解析

drop table testtable;
create external table testtable
(
  id         decimal(18),
  recordid   string
) partitioned by (data_dt string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
"separatorChar" = ",",
"quoteChar"     = "'",
"escapeChar"    = "\\") location '/user/flume/testtable';

alter table testtable add partition (data_dt='2018-04-13') location '/user/flume/testtable/2018-04-13';

你可能感兴趣的:(大数据)