Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@minotaur.apache.org Received: (qmail 2651 invoked from network); 3 Sep 2009 18:57:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Sep 2009 18:57:02 -0000 Received: (qmail 36521 invoked by uid 500); 3 Sep 2009 18:57:01 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 36501 invoked by uid 500); 3 Sep 2009 18:57:01 -0000 Mailing-List: contact hbase-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-user@hadoop.apache.org Delivered-To: mailing list hbase-user@hadoop.apache.org Received: (qmail 36491 invoked by uid 99); 3 Sep 2009 18:57:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 18:57:01 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of olariuadrian@gmail.com designates 209.85.219.208 as permitted sender) Received: from [209.85.219.208] (HELO mail-ew0-f208.google.com) (209.85.219.208) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Sep 2009 18:56:53 +0000 Received: by ewy4 with SMTP id 4so220139ewy.36 for ; Thu, 03 Sep 2009 11:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ZtacopOtIz68svwFPGg/KPJQNtbEZp0icazUwGz4rec=; b=Gk0QDu25Ux9WbXmyo3YwSrYPEF8nfygXfs3CCkom8JWicWaI3eAPY0smIuKTcG2iOb /e1zuY2IdPplnFHIOCWDr+YAUXoxDhWpZ2PRUzzx1ImSaJQ9m+tvdy1G8JrvR/O4EujU hpGPUfUE8bVx33NXUrYqYdu7cDkZuu2HJqbLE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AHfTvzU6wi9hQHX2id/ptjbZfxr6ZbyWuSXKnWmodFSnScw2CV0pzHWOgbjAr27k/l j7KUFDlw5QgHA748HZaqsLALJgWs7ywbjvMRktJzCYGh+++mmyQkM7Ev2eC9P3uOrt59 fcToMBmrUKmFtZQXlppzUPNKVloS5Ebwxt8vw= MIME-Version: 1.0 Received: by 10.216.74.71 with SMTP id w49mr569832wed.135.1252004191498; Thu, 03 Sep 2009 11:56:31 -0700 (PDT) In-Reply-To: <49701.75.212.242.144.1252001235.squirrel@webmail.streamy.com> References: <1474a0f20909031008k1c8b47bcmae792e88655ec13c@mail.gmail.com> <49380.75.212.242.144.1251999464.squirrel@webmail.streamy.com> <1474a0f20909031046u41f57bb7ke65bf64da7dedcaa@mail.gmail.com> <49701.75.212.242.144.1252001235.squirrel@webmail.streamy.com> Date: Thu, 3 Sep 2009 21:56:31 +0300 Message-ID: <1474a0f20909031156y290daef8jd6551a7e4e5c1878@mail.gmail.com> Subject: Re: Filtering by SingleColumnValueFilter From: Adrian Olariu To: hbase-user@hadoop.apache.org, jlist@streamy.com Content-Type: multipart/alternative; boundary=0016e6d7eea617705d0472b0f16e X-Virus-Checked: Checked by ClamAV on apache.org --0016e6d7eea617705d0472b0f16e Content-Type: text/plain; charset=ISO-8859-1 The behavior described in the first pace was whit FilterList.MUST_PASS_ALL. I did copy/paste without checking twice, sorry about that. Found row: keyvalues={135/F1:c2/1251994608272/Put/vlen=1} Found row: keyvalues={141/F1:c1/1251994608289/Put/vlen=1} Found row: keyvalues={143/F1:c1/1251994608293/Put/vlen=1, 143/F1:c2/1251994608293/Put/vlen=1} Found row: keyvalues={144/F1:c1/1251994608295/Put/vlen=1} Found row: keyvalues={152/F1:c2/1251994608314/Put/vlen=1} this results I'm getting when I'm using must MUST_PASS_ALL. On Thu, Sep 3, 2009 at 9:07 PM, Jonathan Gray wrote: > You are using FilterList.MUST_PASS_ONE... That is an OR condition. > > You want FilterList.MUST_PASS_ALL if you want it to require both > conditions to be met. > > If you want to include _other_ columns from that family if _these_ two > conditions are met (but the row skipped if the two conditions does not > match), then wrap the FilterList w/ a SkipFilter and use addFamily rather > than addColumns. If you just want the row and the two columns you are > checking for, use addColumn calls and don't use the SkipFilter. > > Hope that helps... and hope it works as you expect :) > > Is there somewhere we could add better documentation? FilterList should > explain AND/OR operations. > > JG > > On Thu, September 3, 2009 10:46 am, Adrian Olariu wrote: > > Thanks for quick replay, I want only the rows that matches BOTH > > conditions. Detailed: all the rows that have this two columns and the > > values from this two columns must match values specified in code. > > > > On Thu, Sep 3, 2009 at 8:37 PM, Jonathan Gray wrote: > > > > > >> That filter just underwent a rewrite this week, there is certainly > >> possibility for a bug... However it does seem you are seeing expected > >> behavior. > >> > >> What exactly are you trying to do? You want to return the entire row > >> if it makes the value (get all columns in the family if one column > >> matches), if it matches BOTH, if it matches EITHER... I don't follow > >> exactly what you want to have as the end result returned to the client. > >> > >> Could you define more specifically what you want your result to be? > >> > >> > >> JG > >> > >> > >> On Thu, September 3, 2009 10:08 am, Adrian Olariu wrote: > >> > >>> Hi, > >>> I'm trying to use some filters and the results are not like expected. > >>> Maybe there it's a bug. I'm using HBase 0.20.0 RC3 > >>> I'm trying to filter rows using SingleColumnValueFilter like this: > >>> Scan s = new Scan(); > >>> > >>> > >>> > >>> Filter filter1 = new SingleColumnValueFilter(Bytes.toBytes("F1"), > >>> Bytes.toBytes("c1"), CompareOp.EQUAL, Bytes.toBytes("1")); > >>> Filter filter2 = new SingleColumnValueFilter(Bytes.toBytes("F1"), > >>> Bytes.toBytes("c2"), CompareOp.EQUAL, Bytes.toBytes("1")); > >>> List rowFilters = new ArrayList(); > >>> rowFilters.add(filter1);rowFilters.add(filter2); Filter filter = new > >>> FilterList(FilterList.Operator.MUST_PASS_ONE, > >>> rowFilters); > >>> > >>> s.addColumn(Bytes.toBytes("F1"), Bytes.toBytes("c1")); > >>> s.addColumn(Bytes.toBytes("F1"), Bytes.toBytes("c2")); > >>> s.setFilter(filter); > >>> > >>> long startTime = System.currentTimeMillis(); ResultScanner scanner = > >>> table.getScanner(s); > >>> > >>> This filter returns all rows the contains F1:c1 whit val "1" or > >>> contains F1:c2 whit val "1" or contains both. > >>> If I replace "addColumn" methods whit s.addFamily("F1"); the scanner > >>> returns all rows from the table whit no filtering eaven if the > >>> F1:c1/c2 > >>> columns doesn't exist > >>> > >>> How can I get only the rows that matches all the conditions? > >>> > >>> > >>> > >>> Thank you, > >>> Olariu Adrian. > >>> > >>> > >>> > >> > >> > > > > --0016e6d7eea617705d0472b0f16e--