Does regexp_count work in athena?

0

Hi all,

I've googeld the function regexp_count and all I can see that it's supported by presto and by athena. But I'm using it like: , case when wc.da_waarnemingsequence not like '%Q02%' and (regexp_count(wc.da_waarnemingsequence, 'B01') = 1) then 1 else 0 end Aantal_Spookzendingen

I get the error: function regexp_count not registered. Is there an alternative way to use a regexp_count?

已提问 1 年前204 查看次数
1 回答
0
已接受的回答

I was able to replicate this issue in Athena V2. regexp_count is one of the functions for which support was added in V3. Please change your Athena version to V3 using these instructions - https://docs.aws.amazon.com/athena/latest/ug/engine-versions-changing.html

When I change it back to V3, I was able to execute the below query.

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

Please let me know if you have any questions.

profile pictureAWS
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则