hive having count 不能去重

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

 

特此记录一下

 

你可能感兴趣的:(hive,去重,having count,计数)