我使用serde读取带有分隔符的特定格式的数据|
我的一行数据可能看起来像:key1=value2 | key2=value2 | key3=“va,lues”,我创建了如下配置单元表:
CREATE EXTERNAL TABLE(
field1 STRING,
field2 STRING,
field3 STRING
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
"input.regex" = "([^\\|]*)\\|([^\\|]*)\\|([^\\|]*)",
"output.format.string" = "%1$s %2$s %3$s"
)
STORED AS TEXTFILE;
我需要提取所有值,忽略所有配额(如果存在)。结果看起来像是
value2 value2 va , lues
如何更改extractig值的当前regexp?
1条答案
按热度按时间gwo2fgha1#
我目前可以提供2个选择,没有一个是完美的。
顺便说一句,
"output.format.string"
已过时且无效。1
2