先把句子拆成单个单词,再行专列,再利用子查询做聚合。
select word, count(1) as cnts from
(select explode(split(sentence, ",")) as word from table) t
group by word
order by cnts desc;
先把句子拆成单个单词,再行专列,再利用子查询做聚合。
select word, count(1) as cnts from
(select explode(split(sentence, ",")) as word from table) t
group by word
order by cnts desc;