【发布时间】:2015-12-30 13:32:14
【问题描述】:
【问题讨论】:
-
不确定是否可以不编写 UDF。
标签: regex hadoop hiveql hue apache-hive
【问题讨论】:
标签: regex hadoop hiveql hue apache-hive
您可以通过这种方式创建使用正则表达式作为分隔符的表:
数据,把数据放到hdfs
1 2 3 4
a b c d
创建表:
//grammar for create table
CREATE TABLE test1(
a string,
b string,
c string,
d string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe' WITH SERDEPROPERTIES
(
"input.regex" ="([^\\s]*)\\s+([^\\s]*)\\s+([^\\s]*)\\s+([^\\s]*)",
"output.format.string" = "%1$s %2$s %3$s %4$s"
)
LOCATION '/test1/';
【讨论】: