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 1B8CB6C3D for ; Fri, 29 Jul 2011 18:15:43 +0000 (UTC) Received: (qmail 20795 invoked by uid 500); 29 Jul 2011 18:15:40 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 20726 invoked by uid 500); 29 Jul 2011 18:15:39 -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 20718 invoked by uid 99); 29 Jul 2011 18:15:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 18:15:39 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jdcryans@gmail.com designates 74.125.83.41 as permitted sender) Received: from [74.125.83.41] (HELO mail-gw0-f41.google.com) (74.125.83.41) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 18:15:33 +0000 Received: by gwaa20 with SMTP id a20so879052gwa.14 for ; Fri, 29 Jul 2011 11:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+fwghXg7h1og+YriGJyRUXGBLYBL5rsACG4NfV8wf3A=; b=CdFS1YEygmZC7he2ppmYZIqjnsx8tfj9dOOcjU48gpSyLiZbfMppXlIE7LxxGEmMbE mYQAPJ2OlbujsNmUI8OV+zAViQmM9C6E7HrN8kKTltr4syJIYJpYLeIszXD6SvFOmI/s p3ZL+4VnvU/EZaykpeDlFiRKFLreC7ct9QTj0= MIME-Version: 1.0 Received: by 10.101.6.22 with SMTP id j22mr1610905ani.22.1311963312246; Fri, 29 Jul 2011 11:15:12 -0700 (PDT) Sender: jdcryans@gmail.com Received: by 10.101.70.6 with HTTP; Fri, 29 Jul 2011 11:15:12 -0700 (PDT) In-Reply-To: References: Date: Fri, 29 Jul 2011 11:15:12 -0700 X-Google-Sender-Auth: tNnsq7Uk1qERJYrKHWbXGAvcbqo Message-ID: Subject: Re: Filter Rows on last 4 bytes From: Jean-Daniel Cryans To: user@hbase.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org You need to write your own comparator (sorry if I didn't say it plainly like that the first time). J-D On Fri, Jul 29, 2011 at 12:15 AM, Shuja Rehman wrot= e: > Yes, I have look that =A0But I did not find any comparator which takes > starting index and length to match. I was thinking to have such type of > comparator. > > Filter rf =3D new RowFilter(CompareOp.EQUAL, new > BinaryComparator(Bytes.toBytes(ID), StartingIndex, Length); > > And, about restriction, yes first four bytes will give me a subset which > further needs to filter on the basis of next 4 bytes. > > > On Wed, Jul 27, 2011 at 11:45 PM, Jean-Daniel Cryans wrote: > >> You will need to use a RowFilter with a Comparator that only looks at >> the last 4 bytes, >> >> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/RowFilter= .html >> >> FYI unless you are restricting your scans on a few rows, doing this on >> a whole table won't scale as it will do a full table scan. >> >> J-D >> >> On Wed, Jul 27, 2011 at 7:34 AM, Shuja Rehman >> wrote: >> > Hi, >> > >> > I have the key consist of two integers (4+4=3D8 Bytes). and i want to >> filter >> > the rows on the basis of second integer which means need to compare la= st >> 4 >> > bytes of key. If last 4 bytes matched with input integer then row shou= ld >> > include in the return results. Can you ppl let me know how to do this >> with >> > java API. >> > >> > Thanks >> > >> > -- >> > Regards >> > Shuja-ur-Rehman Baig >> > >> > >> > > > > -- > Regards > Shuja-ur-Rehman Baig > >