在Athena中是否支持regexp_count函数?

0

【以下的问题经过翻译处理】 通过Google 搜索, 我了解到regexp_count 函数, 并且看到该函数被 presto 和 athena 支持。但我像这样使用它时: , case when wc.da_waarnemingsequence not like '%Q02%' and (regexp_count(wc.da_waarnemingsequence, 'B01') = 1) then 1 else 0 end Aantal_Spookzendingen

我收到错误:函数 regexp_count 未注册。有没有其他方法可以使用 regexp_count?

profile picture
專家
已提問 5 個月前檢視次數 37 次
1 個回答
0

【以下的回答经过翻译处理】 我在Athena V2中成功复现了这个问题。regexp_count是在V3中添加支持的函数之一。请根据以下说明将您的Athena版本更改为V3 - https://docs.aws.amazon.com/athena/latest/ug/engine-versions-changing.html

当我改回V3后,我能够执行下面的查询。

SELECT regexp_count('1a 2b 14m', '\s*[a-z]+\s*');

profile picture
專家
已回答 5 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南