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?

asked a year ago197 views
1 Answer
0
Accepted Answer

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
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions