Hadoop 在配置单元中对非结构化数据实施逐字计数时出错

Hadoop 在配置单元中对非结构化数据实施逐字计数时出错,hadoop,hive,max,apache-pig,Hadoop,Hive,Max,Apache Pig,我运行此配置单元查询是为了在非结构化数据上获得逐字计数 select a, count(*) from (select(EXPLODE(SPLIT(regexp_replace(upper(word,'[-!@#$%&*]',''))) AND EXPLODE(SPLIT(regexp_replace(UPPER(word,'[^A-Za-z0-9 ]','')))) as A from file)q group by a; 但我认为这是一个错误。我想不出解决办法 失败:Semanti

我运行此配置单元查询是为了在非结构化数据上获得逐字计数

select a, count(*) from (select(EXPLODE(SPLIT(regexp_replace(upper(word,'[-!@#$%&*]',''))) AND EXPLODE(SPLIT(regexp_replace(UPPER(word,'[^A-Za-z0-9 ]','')))) as A from file)q group by a;
但我认为这是一个错误。我想不出解决办法

失败:SemanticException[错误10014]:第1行:46个错误参数 :没有类的匹配方法 org.apache.hadoop.hive.ql.udf.UDFRegExpReplace为字符串。可能的 选项:FUNCstring,string,string


regexp_replace用于替换它,它有3个参数

org.apache.hadoop.io.Text s、org.apache.hadoop.io.Text regex、org.apache.hadoop.io.Text替换

您应该使用regexp\u extract

evaluate(String s, String regex)

但是我使用了三个参数:EXPLODESPLITregexp\u replaceUPPERword,[^A-Za-z0-9],->要处理的字符串,要替换的字符串,[^A-Za-z0-9],,替换你为UPPER,UPPERword,[^A-Za-z0-9]给出的3个参数,好的,即使我不给出UPPER,直接给出regexp\u replace,我也会得到同样的错误。试过了,但没能解决问题从selectEXPLODESPLITregexp_replaceword“[-!@$%&*]”和EXPLODESPLITregexp_replaceword“[^a-Za-z0-9]”中选择一个、计数*,作为aSQL 1的from fileq组,这是个坏主意。从正确格式化查询开始。