Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A6A59EFB for ; Tue, 7 Aug 2012 09:57:56 +0000 (UTC) Received: (qmail 13715 invoked by uid 500); 7 Aug 2012 09:57:55 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 13633 invoked by uid 500); 7 Aug 2012 09:57:55 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 13569 invoked by uid 99); 7 Aug 2012 09:57:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2012 09:57:55 +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 (nike.apache.org: domain of jmozah@gmail.com designates 209.85.213.41 as permitted sender) Received: from [209.85.213.41] (HELO mail-yw0-f41.google.com) (209.85.213.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Aug 2012 09:57:48 +0000 Received: by yhr47 with SMTP id 47so4186835yhr.14 for ; Tue, 07 Aug 2012 02:57:27 -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=BMvaoGBS8C76N6UYAPhZTOVgKuy2EjNpgNFxCCvuIO8=; b=tWJzjISVVVyIVAyEU61i4gRK6kYTVbvU8hN/cJbLqJT4DOKoLdSd4rZQ85QDrm1/x+ iuLxkSplCHNm1xPzzrvJ5uhUGoq/uReE9zpgO/HtcsrY3DA82OZ8TL4aT6Yc3f9TUO/f Eou65vrQsv0SHG0J5wn4VfDRkHfHERtnwPMBEXt0d9pXmF3mTW/79OTXRt5s0Ee0eGCk Le6BChspCnKL/gYR4NCS7G4ae8kDohaeWRqv/y7ZbrmSFcYpz//1NKlnnB3swiazHijg O4gBn9HufA/Ny0gG5PFkh21Enqu/MyyeWltlU206IW4c1OJN59o71TVI/HcIDCmpLamn w69A== MIME-Version: 1.0 Received: by 10.50.158.229 with SMTP id wx5mr8047181igb.23.1344333447082; Tue, 07 Aug 2012 02:57:27 -0700 (PDT) Received: by 10.231.47.65 with HTTP; Tue, 7 Aug 2012 02:57:26 -0700 (PDT) In-Reply-To: References: <26B78B7F-D21B-4F41-BAB8-D5080E3536C4@gmail.com> Date: Tue, 7 Aug 2012 15:27:26 +0530 Message-ID: Subject: Re: [potential bug]Find rows which do not have any of the given columns From: J Mohamed Zahoor To: dev@hbase.apache.org Content-Type: multipart/alternative; boundary=14dae934062b92b39604c6aa05e9 --14dae934062b92b39604c6aa05e9 Content-Type: text/plain; charset=ISO-8859-1 Hi Nice one. But i think this is valid behavior. Time ranges are something which qualifies certain rows to be made available to the client (something which is related to MVCC). Once a certain rows are qualified... then the filters are applied on them. The fact that both can be set simultaneously on a "Scan" object hints that they orthogonal. ./zahoor On Tue, Aug 7, 2012 at 2:10 AM, Shrijeet Paliwal wrote: > - user > +dev > > Hi Devs, > > Please follow the discussion to get full context. tl:dr "Did a scan with > timerange and filters, scan o/p was incorrect. Repeated scan with filter > only, scan o/p was correct." > > HBase version : 0.90.3 > Hadoop : CDH3u0 > Issues: > The scan when set with both a time range and a filter can behave in > an unintuitive way. Calling it unintuitive instead of wrong, since I do not > know if this is a known limitation of scan. Picture a filter setup like > mine - "Filter rows which have cells pertaining to certain columns". This > filter is set on a scan which has a time range constraint as well. AFAIK > we skip Hfiles based on metadata when dealing with time ranges. If a region > has two Hfiles. One of the Hfiles has cells for unwanted columns but the > other one does not - we may get incorrect result based on what how time > range is set (If the time range scan optimizer skips the Hfile containing > unwanted cells). > > Does this sound like a valid issue? Also I can see this happening to more > than one kind of SkipFilters. > > -Shrijeet > > > On Mon, Aug 6, 2012 at 11:38 AM, Shrijeet Paliwal > wrote: > > > It seems setting time range is a problem , I was doing (* > > scan.setTimeRange(Long.**valueOf(args[4]), Long.valueOf(args[5]));)* > > * > > * > > I was working on assumption that filter logic works before scan logic, in > > other words a KV dropped by filter will not make it to scan. In case of > > time range this might not be true. > > > > -Shrijeet > > > > > > On Mon, Aug 6, 2012 at 9:25 AM, jmozah wrote: > > > >> Hmmm.. Missed it. Otherwise i dont spot anything wrong in this. > >> are you sure about the column names? > >> > >> ./zahoor > >> > >> > >> On 06-Aug-2012, at 9:34 PM, Shrijeet Paliwal > >> wrote: > >> > >> > I am using FilterList. Could you elaborate? > >> > > >> > On Mon, Aug 6, 2012 at 8:48 AM, jmozah wrote: > >> > > >> >> > >> >> > >> >> Use FilterList instead of List of Filters. > >> >> > >> >> ./Zahoor > >> >> > >> >> On 06-Aug-2012, at 12:12 PM, Shrijeet Paliwal < > shrijeet@rocketfuel.com > >> > > >> >> wrote: > >> >> > >> >>> Hi All, > >> >>> > >> >>> I am writing a job which finds rows that do not have a cell > >> corresponding > >> >>> to any of the columns in the given set of columns. > >> >>> This is how I have configured my scan (a combination of > >> lQualifierFilters > >> >>> and SkipFilter) > >> >>> > >> >>> columnsSet = Splitter.on(',') .split(columns); //columns is a csv > >> >>> containing column names > >> >>> List qualifierFilters = new ArrayList(); > >> >>> for (String qual : columnsSet) { > >> >>> qualifierFilters.add(new QualifierFilter(CompareOp.NOT_EQUAL, > >> >>> new BinaryComparator(Bytes.toBytes(qual)))); > >> >>> } > >> >>> Filter skipFilter = new SkipFilter(new > >> >>> FilterList(Operator.MUST_PASS_ALL, qualifierFilters)); > >> >>> Scan scan = new Scan(); > >> >>> scan.addFamily(Bytes.toBytes(family)); > >> >>> scan.setCacheBlocks(false); > >> >>> scan.setCaching(1000); > >> >>> scan.setFilter(skipFilter); > >> >>> scan.setTimeRange(Long.valueOf(args[4]), Long.valueOf(args[5])); > >> >>> > >> >>> In my test table the scan worked as expected. But in production > run, I > >> >> got > >> >>> rows which had cells containing one of the given qualifiers (not > >> >> expected) > >> >>> Can some one help me spot the mistake? > >> >>> > >> >>> -Shrijeet > >> >> > >> >> > >> > >> > > > --14dae934062b92b39604c6aa05e9--