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?

gefragt vor einem Jahr204 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen