【发布时间】:2014-01-24 21:08:50
【问题描述】:
对于处理日志,我想使用 Apache Hive regEx serde,但我只找到了使用 String 作为表列数据类型的示例。
现在我的问题是:是否支持基于日期的类型、整数和数组,还是只是字符串?
此示例(和其他示例)仅使用字符串:
CREATE TABLE access_log (
remote_ip STRING,
request_date STRING,
method STRING,
request STRING,
protocol STRING
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
"input.regex" = "([^ ]) . . [([^]]+)] \"([^ ]) ([^ ]) ([^ \"])\" *",
"output.format.string" = "%1$s %2$s %3$s %4$s %5$s"
)
STORED AS TEXTFILE
;
【问题讨论】: