配置单元中的函数regex\u extract无效

0md85ypi  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(338)

正在尝试在配置单元中执行查询:

select regex_extract(col,'regex',1) from tbl;

验证我使用的正则表达式是否正确。
错误:

FAILED: SemanticException [Error 10011]: Invalid function regex_extract
pw136qt2

pw136qt21#

考虑使用 regexp_extract 而不是 regex_extract 在Hive里。下面是regexp\u摘录的正确语法:

regexp_extract(string subject, string pattern, int index)

下面是hive文档中的一个示例

regexp_extract('foothebar', 'foo(.*?)(bar)', 2) returns 'bar.'

相关问题