特牛网址导航

hive中count(distinct)的相关优化_hive count distinct优化-CSDN博客

网友收藏
文章浏览阅读4.2k次,点赞2次,收藏22次。1、单个count(distinct)例子:select count(distinct id) as num from table_name方法1(简单,但很多时候效果不明显)select count(id) as num from (select id from table_name group by id) a;方法2(对分组字段进行加盐操作)select sum(tag_num) as numfrom (select tag ,cou_hive count distinct优化