- 链接地址:https://blog.csdn.net/qq_42456324/article/details/124303927
- 链接标题:hive中count(distinct)的相关优化_hive count distinct优化-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:4256
文章浏览阅读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优化
版权声明:本文发布于特牛网址导航 内容均来源于互联网 如有侵权联系删除