hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 1983 ddi <ddi6...@gmail.com>
Subject How can i realize the “count(distinct )” function in hive ?
Date Mon, 13 Dec 2010 12:06:47 GMT
Hi all:
     I am trying to develop a function like "count ( distinct )" in hive ,
so here I  am trying to write a  UDAF which using a HashMap container to
store all the keys.

and at last ,It is expected to get the key size by calling map.size() in my
UDAF class , after which I will get the result like "count(distinct)" .

by I  am  confused about how can I write the UDAF class, is there anybody
who can give me a favor and thanks a lot if there is an example .

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message