【问题标题】:Error in regex hive正则表达式配置单元中的错误
【发布时间】:2013-11-04 10:11:12
【问题描述】:

在 Hive 中创建表时:

创建表 lg(ip string, month string, gt string, id int, id1 int)
行格式 serde 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
带有 serdeproperties(
"input.regex" = " ([^ ]) - - [([^]]+)] \"([^ ]) ([^ ]) ([^ \"])\")?" "output.format.string" = "%1$s %2$s %3$s %4$s %5$s" )
存储为文本文件;

我收到一个错误:

ERROR:FAILED: Parse Error: line 5:0 mismatched input '"output.format.string"' expecting ) near '"  ([^ ]) - - [([^]]+)] \"([^ ]) ([^ ]) ([^ \"])\")?"' in table properties

TABLE DATA: 10.22.17.186 - - [15/Aug/2009:15:50:35 -0700] "GET /assets/css/the-associates.css HTTP/1.1" 200 15779

【问题讨论】:

    标签: regex hadoop hive


    【解决方案1】:

    尝试跟随输入正则表达式?

    'input.regex' = ' ([^ ]) - - [([^]]+)] "([^ ]) ([^ ]) ([^ "])")?'
    

    【讨论】:

    • 我已经解决了问题 "([^*]) ([^*]) ([^*]) \[([^]]+)\] ([^ \"]* |\"[^\"]*\") ([^*]) ([^*])?"但是当我将查询编写为 select * from lg 时,它显示所有空值。
    • 试试 "([^*]) ([^*]) ([^*]) \[([^\]]+)\] ([^ \"]*|\" [^\"]*\") ([^*]) ([^*])?"
    猜你喜欢
    • 2021-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多