У меня есть таблица со списком URL
url
http://03cubsml.baseball.cbssports.com/stats/stats-main?selectedplayer=2122997
http://08flb.baseball.cbssports.com/scoring/standard
http://100-poems.com/poems/life/index2.htm
http://10000lakesrbl.baseball.cbssports.com/stats/stats-main
http://1000pictures.com/view.htm?cscenic/sunset+fnoy-2011-07-21-211010+a1112212325323435434553545885949hh9
http://05command.wikidot.com/tech-hub-tag-list
http://10000lakesrbl.baseball.cbssports.com/players/playerpage/2504134
http://1001goroskop.ru/gadanie/?kniga-sudeb
http://04spfbl.baseball.cbssports.com/standings/overall
http://05command.wikidot.com
http://05command.wikidot.com/tech-hub-tag
http://05fbl.baseball.cbssports.com/stats/stats-main
http://100-poems.com/poems/life/0464004.htm
http://10000islands.proboards.com/board/129/tito-headquarters
http://10000islands.proboards.com/thread/11959/tip-islands-party?page=477
http://10000islands.proboards.com/thread/14172/illustrious-house-improving-wordiness?page=82
http://1000pictures.com/view.htm?cscenic/sunset+feilat05-040+a1112212325323435434553545885949hh9
http://1001-rimes.com/listeperson.php?letter=%E9&start=30
http://1001-rimes.com/listeperson.php?letter=ques&start=30
http://1001goroskop.ru/?god
Теперь я разделяю URL-адреса на список слов, присутствующих в URL-адресе, используя следующий код
Create table url_keyword
(url string,
keywords Array<String>);
Insert Overwrite table url_keyword
as
Select url,split(lcase (parse_url (url,'PATH')),"[=/_%:|^$#@!&,?*_~+.`<>(){}' \-\;\" \\ \\[\\]{[0 -9]+ }]") AS keywords from url_table;
Вывод, который я получаю, имеет URL-адрес и ключевые слова (массив с разделением пробелами), сгенерированные путем разбиения массива. Теперь я хочу получить количество слов, сгенерированное каждым URL, но всякий раз, когда я пытаюсь сделать
regexp_replace(keywords,' ',',')
чтобы преобразовать его в массив, разделенный запятыми, чтобы я мог использовать функцию длины, чтобы получить количество слов, я получаю ошибку
Wrong arguments '','': No matching method for class org.apache.hadoop.hive.ql.udf.UDFRegExpReplace with (array, string, string). Possible choices: _FUNC_(string, string, string)
Как мне добиться подсчета слов в этом случае?
Вывод моего ключевого слова выглядит как
stats stats main
scoring standard
poems life index htm
stats stats main
view htm
tech hub tag list
players playerpage
gadanie
standings overall
tech hub tag
stats stats main
poems life htm
board tito headquarters
thread tip islands party
thread illustrious house improving wordiness
view htm
listeperson php
listeperson php