在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
EXPERT
demandé il y a 5 mois37 vues
1 réponse
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
EXPERT
répondu il y a 5 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions