hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Marc Spaggiari <jean-m...@spaggiari.org>
Subject Re: HBase table - distinct values
Date Wed, 10 Oct 2012 11:52:46 GMT
Hi Raviprasad,

What you can do, if deptno is you key, or the first part of you key,
is to scan for the first entry, then increment it by one and scan with
this value.

Let's take an example.

Key format is DEPTNO + ID (XXYY)
You table content is:

If you scan for the first entry you will find 0101. You extract 01
form that. Then you search for the next DEPTID just above this one.
You first key for the search will be 02. And you will find 0207. You
do the same. Start key for your search will be 03 and you will find

And so on.

the main issue you will have is that is you have only few DEPTNO, you
will hotspot one server, then another one, and so on. So may you
should think about your schema first. Like you can have a table with
only the deptno so to get the list of distincts deptno you just scan
this table? etc.


2012/10/10, raviprasad.t@polarisft.com <raviprasad.t@polarisft.com>:
> Hi all,
>   Is it possible to select distinct value from Hbase table.
> Example :-
>    what is the equivalant code for the below Oracle code  in Hbase  ?
>   Select count (distinct deptno) from emp ;
> Regards
> Raviprasad. T
> This e-Mail may contain proprietary and confidential information and is sent
> for the intended recipient(s) only.  If by an addressing or transmission
> error this mail has been misdirected to you, you are requested to delete
> this mail immediately. You are also hereby notified that any use, any form
> of reproduction, dissemination, copying, disclosure, modification,
> distribution and/or publication of this e-mail message, contents or its
> attachment other than by its intended recipient/s is strictly prohibited.
> Visit us at http://www.polarisFT.com

View raw message