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?

preguntada hace un año204 visualizaciones
1 Respuesta
0
Respuesta aceptada

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
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas