hive having count 不能去重

编程技术  /  houtizong 发布于 3年前   123

hive在使用having count()是,不支持去重计数

 

hive (default)> select imei from t_test_phonenum where ds=20150701 group by imei having count(distinct phone_num)>1 limit 10; 

FAILED: SemanticException [Error 10002]: Line 1:95 Invalid column reference 'phone_num'

 

hive (default)> select imei from t_test_phonenum where ds=20150701 group by imei having count(phone_num)>1 limit 10;          

Total MapReduce jobs = 1

Launching Job 1 out of 1

Number of reduce tasks not specified. Estimated from input data size: 1

In order to change the average load for a reducer (in bytes):

  set hive.exec.reducers.bytes.per.reducer=<number>

In order to limit the maximum number of reducers:

  set hive.exec.reducers.max=<number>

In order to set a constant number of reducers:

  set mapred.reduce.tasks=<number>

Starting Job = job_201503201830_2570778, Tracking URL = http://10-198-131-242:8080/jobdetails.jsp?jobid=job_201503201830_2570778

Kill Command = /data/home/hadoop-1.2.1/libexec/../bin/hadoop job  -kill job_201503201830_2570778

Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 1

2015-07-03 11:07:16,954 Stage-1 map = 0%,  reduce = 0%

2015-07-03 11:07:33,530 Stage-1 map = 100%,  reduce = 0%

2015-07-03 11:07:47,620 Stage-1 map = 100%,  reduce = 33%, Cumulative CPU 14.32 sec

2015-07-03 11:07:55,742 Stage-1 map = 100%,  reduce = 100%, Cumulative CPU 20.78 sec

MapReduce Total cumulative CPU time: 20 seconds 780 msec

Ended Job = job_201503201830_2570778

MapReduce Jobs Launched: 

Job 0: Map: 1  Reduce: 1   Cumulative CPU: 20.78 sec   HDFS Read: 17371199 HDFS Write: 98 SUCCESS

Total MapReduce CPU Time Spent: 20 seconds 780 msec

OK

02541213XXXXX

 

特此记录一下

 

上一篇:Shell 流程控制
下一篇:SecureCRT快捷键

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!

留言需要登陆哦

技术博客集 - 网站简介:
前后端技术:
后端基于Hyperf2.1框架开发,前端使用Bootstrap可视化布局系统生成

网站主要作用:
1.编程技术分享及讨论交流,内置聊天系统;
2.测试交流框架问题,比如:Hyperf、Laravel、TP、beego;
3.本站数据是基于大数据采集等爬虫技术为基础助力分享知识,如有侵权请发邮件到站长邮箱,站长会尽快处理;
4.站长邮箱:[email protected];

      订阅博客周刊 去订阅

文章归档

文章标签

友情链接

Auther ·HouTiZong
侯体宗的博客
© 2020 zongscan.com
版权所有ICP证 : 粤ICP备20027696号
PHP交流群 也可以扫右边的二维码
侯体宗的博客