Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE33ADDD5 for ; Thu, 11 Oct 2012 09:38:09 +0000 (UTC) Received: (qmail 6787 invoked by uid 500); 11 Oct 2012 09:38:08 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 6082 invoked by uid 500); 11 Oct 2012 09:38:02 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 4879 invoked by uid 99); 11 Oct 2012 09:38:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 09:38:00 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yutoo.yanio@gmail.com designates 209.85.214.169 as permitted sender) Received: from [209.85.214.169] (HELO mail-ob0-f169.google.com) (209.85.214.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 09:37:55 +0000 Received: by mail-ob0-f169.google.com with SMTP id va7so1801089obc.14 for ; Thu, 11 Oct 2012 02:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oqT9Q8F8YQ3Nbm8dxqZVZBzQNrphdbBP0ma/FjlUZzQ=; b=lyhNoCOfNIkdaMfo350BacPzjSRoxuCKA2nT+ezCUnmOkG1v4NyzGIOO7Sgx3CF3zc F3IVvi9asGFtKculmV8HYKSCjdFg5KTNO9EqTNqqDlpjGQo2iMghZNpMWb8s8GR5OEiS zrVXN4TKVNr9B/Z8VrgzqIgYRGXo7EBA+Zrm3HFN1MLuUjiL2MJl6Im2mtaFZ5hcgAKH FXHBCM4tkmxJ66IDcUd4SNxwa5ZBZEPyfqY2tFGjQraESWVwWGEkL1uT+jMiRchFNela EfmlEnUFvN76s+Fqg23LPxVVaW+6TN2o0nFooaXObCBwO6Hs42Lu8KpMVOVXsueykd0t PiWg== MIME-Version: 1.0 Received: by 10.60.7.225 with SMTP id m1mr160319oea.122.1349948255173; Thu, 11 Oct 2012 02:37:35 -0700 (PDT) Received: by 10.76.11.34 with HTTP; Thu, 11 Oct 2012 02:37:35 -0700 (PDT) In-Reply-To: <50765103.e1cb440a.4ff3.ffff823cSMTPIN_ADDED@mx.google.com> References: <0CE69E9126D0344088798A3B7F7F80863A4E222F@szxeml531-mbx.china.huawei.com> <0CE69E9126D0344088798A3B7F7F80863A4E2595@szxeml531-mbx.china.huawei.com> <50765103.e1cb440a.4ff3.ffff823cSMTPIN_ADDED@mx.google.com> Date: Thu, 11 Oct 2012 13:07:35 +0330 Message-ID: Subject: Re: HBase table - distinct values From: yutoo yanio To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=e89a8fb1ef4036fad804cbc5526d X-Virus-Checked: Checked by ClamAV on apache.org --e89a8fb1ef4036fad804cbc5526d Content-Type: text/plain; charset=ISO-8859-1 you can create a table with key=deptno or every value that you need distinct value of it. scan of this table shows the distinct values. On Thu, Oct 11, 2012 at 8:22 AM, Ramkrishna.S.Vasudevan < ramkrishna.vasudevan@huawei.com> wrote: > Are you planning to use region splits? Can the rowkey have the deptno? > > Having dept no in another table, may be having a reverse mapping of deptno > to empno may be helpful too if such queries are frequent. > > Regards > Ram > > -----Original Message----- > > From: Anoop Sam John [mailto:anoopsj@huawei.com] > > Sent: Thursday, October 11, 2012 9:32 AM > > To: user@hbase.apache.org > > Cc: hbase-user@hadoop.apache.org > > Subject: RE: HBase table - distinct values > > > > Hi Ravi > > If dept_no is a CF:qualifier, to know all the dept numbers > > (distinct or not) you need a full table scan. As Doug said if it is a > > frequent online query don't think MR is a good choice.. If the data in > > your emp table is huge a full table scan also wont be that good I > > feel.... Can you guys think about storing dept number in another > > table? If you people need query like select from emp > > where dept_no=? (this query also) you can think about creating > > secondary index implementation and indexing dept_no... You can use > > index table for above query as well as the 1st one you asked about. :) > > > > -Anoop- > > ________________________________________ > > From: raviprasad.t@polarisFT.com [raviprasad.t@polarisFT.com] > > Sent: Wednesday, October 10, 2012 7:51 PM > > To: user@hbase.apache.org > > Cc: hbase-user@hadoop.apache.org; user@hbase.apache.org > > Subject: RE: HBase table - distinct values > > > > Hi, > > Hbase table name :- emp > > Column family :- cf > > Under the column family cf we will be having the field name > > deptno > > > > > > Regards > > Raviprasad. T > > Mobile :- 91- 9894769541 > > > > > > -----Anoop Sam John wrote: ----- > > To: "user@hbase.apache.org" , "hbase- > > user@hadoop.apache.org" > > From: Anoop Sam John > > Date: 10/10/2012 06:18PM > > Subject: RE: HBase table - distinct values > > > > Hi > > Your schema? 'deptno' is a cf:qualifier? > > > > -Anoop- > > ________________________________________ > > From: raviprasad.t@polarisFT.com [raviprasad.t@polarisFT.com] > > Sent: Wednesday, October 10, 2012 4:29 PM > > To: user@hbase.apache.org; hbase-user@hadoop.apache.org > > Subject: HBase table - distinct values > > > > 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 > > > > > > 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= > > --e89a8fb1ef4036fad804cbc5526d--