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 909B610C66 for ; Fri, 4 Apr 2014 10:54:05 +0000 (UTC) Received: (qmail 9730 invoked by uid 500); 4 Apr 2014 10:54:03 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 9674 invoked by uid 500); 4 Apr 2014 10:54:01 -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 9646 invoked by uid 99); 4 Apr 2014 10:53:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Apr 2014 10:53:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ramkrishna.s.vasudevan@gmail.com designates 209.85.192.170 as permitted sender) Received: from [209.85.192.170] (HELO mail-pd0-f170.google.com) (209.85.192.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Apr 2014 10:53:53 +0000 Received: by mail-pd0-f170.google.com with SMTP id v10so3172057pde.15 for ; Fri, 04 Apr 2014 03:53:31 -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=CaOP3wRWf+Z8ReuWZFrTXn2n03DyN+lDEE0hjaA3AsQ=; b=N3edevWlqi+2m1WHUHrn3yOyQ8dDsclwHLRF0D3bBWfrF0+i0/X6N/NWdVQZD4RRBU L4vO5MUyI/9trOURD0tA9cR9dV1BqWHwhacli9QMFkEM0veAxpSjKjsi8FN28XQr6FYu 3MBlASlttEhjX2ilDRXP4LvzLfUIkA+twYUb6qdtB8P0jTwcFgGEO152AZW69L1aL8Wv q+GQB/gYFP911q+kS4IlinRGOVPFVyCE5/eDH3S8VJg1S7jZCTLse+rojt5cp3XZEkaK 9LXG/eLJsqUkwqZ/W6Z27dquK8mGOzQqZY7iyyZXF+bYcfk5o/MjtmjWlf3l2cKLPGqO 4Lug== MIME-Version: 1.0 X-Received: by 10.66.185.39 with SMTP id ez7mr9637898pac.134.1396608811055; Fri, 04 Apr 2014 03:53:31 -0700 (PDT) Received: by 10.68.7.161 with HTTP; Fri, 4 Apr 2014 03:53:30 -0700 (PDT) In-Reply-To: <8E858C3A39F0D046B420FBA6F75448C02FA97214@szxeml513-mbs.china.huawei.com> References: <8E858C3A39F0D046B420FBA6F75448C02FA97188@szxeml513-mbs.china.huawei.com> <8E858C3A39F0D046B420FBA6F75448C02FA971F6@szxeml513-mbs.china.huawei.com> <8E858C3A39F0D046B420FBA6F75448C02FA97214@szxeml513-mbs.china.huawei.com> Date: Fri, 4 Apr 2014 16:23:30 +0530 Message-ID: Subject: Re: Scan with SingleColumnValueFilterfilter giving wrong output From: ramkrishna vasudevan To: "dev@hbase.apache.org" Content-Type: multipart/alternative; boundary=047d7bf0e6cc12c19504f63554cd X-Virus-Checked: Checked by ClamAV on apache.org --047d7bf0e6cc12c19504f63554cd Content-Type: text/plain; charset=ISO-8859-1 There is something called Valuefilter. Check its usage and see if it suits you. Regards Ram On Fri, Apr 4, 2014 at 4:17 PM, ashish singhi wrote: > >> Do you still get row6 for value1 even after setting filterIfMissing as > true? > No. > > Do we something like multi value column value filter ? > > -----Original Message----- > From: ramkrishna vasudevan [mailto:ramkrishna.s.vasudevan@gmail.com] > Sent: 04 April 2014 16:05 > To: dev@hbase.apache.org > Subject: Re: Scan with SingleColumnValueFilterfilter giving wrong output > > >>But for column value 'value1' also I am getting one row i.e., row1 > >>with > col1 > You should get only one row ie. row1 with col1. > Do you still get row6 for value1 even after setting filterIfMissing as > true? > > Regards > Ram > > > On Fri, Apr 4, 2014 at 3:50 PM, ashish singhi >wrote: > > > Hi Ram. > > > > Thanks for your time and explanation. > > I tried by setting true to SingleColumnValueFilter.setFilterIfMissing > > as you mentioned. > > > > It worked for column value 'value2' in output I got only row2 with col1. > > But for column value 'value1' also I am getting one row i.e., row1 > > with col1. As you said " In your first result row6 should not be the > > result (strictly if you want only value1 with col1). You can see that > > it has col3 in the result." > > > > But I want is to find all the columns in the table having mentioned > > column value. Can someone please tell me how to get it ? > > > > -----Original Message----- > > From: ramkrishna vasudevan [mailto:ramkrishna.s.vasudevan@gmail.com] > > Sent: 04 April 2014 15:20 > > To: dev@hbase.apache.org > > Subject: Re: Scan with SingleColumnValueFilterfilter giving wrong > > output > > > > Hi Ashish > > > > I think the behaviour is fine. There is a property called > > filterIfMissing in Single Columnvalue filter. If you don't need a row > > which does not have the given column and value in your query, then you > should set that to true. > > See SingleColumnValueFilter.setFilterIfMissing. > > In your first result row6 should not be the result (strictly if you > > want only value1 with col1). You can see that it has col3 in the result. > > > > In your second result too row6 falls under the same category. > > If a row has more than one cell and if we have found the matching > > cell, the following cells of that row will also be included in the > > result. I hope the same behavior is there in 0.94.11 also. (should be). > > > > Regards > > Ram > > > > > > > > On Fri, Apr 4, 2014 at 2:37 PM, ashish singhi > > > >wrote: > > > > > Hi all. > > > > > > I am using, > > > HBase Version - 0.94.11 > > > Hadoop Version - 2.1.0 > > > > > > I am trying to get columns having the specified value. So for that I > > > am using org.apache.hadoop.hbase.filter.SingleColumnValueFilter class. > > > But when I try to scan table to find columns with column value > > > 'value2', I think I am not getting proper output. > > > > > > Can someone please tell me where I am wrong ? > > > > > > I have a simple hbase table with records. > > > hbase(main):014:0> scan 'testTable' > > > ROW COLUMN+CELL > > > row1 > > > column=colFammily1:col1, timestamp=1396586048561, value=value1 > > > row2 > > > column=colFammily1:col1, timestamp=1396586054526, value=value2 > > > row2 > > > column=colFammily1:col2, timestamp=1396585985022, value=testValue > > > row3 > > > column=colFammily1:col1, timestamp=1396586060989, value=value3 > > > row4 > > > column=colFammily1:col1, timestamp=1396586066037, value=value4 > > > row5 > > > column=colFammily1:col1, timestamp=1396586071842, value=value5 > > > row6 > > > column=colFammily1:col3, timestamp=1396590405939, value=value1 > > > 6 row(s) in 0.0320 seconds > > > > > > First: When I executed scan command with column value 'value1' I got > > > the proper output. > > > hbase(main):023:0> scan 'testTable', {FILTER => > > > org.apache.hadoop.hbase.filter.SingleColumnValueFilter.new(org.apache. > > > hadoop.hbase.util.Bytes.toBytes('colFammily1'),org.apache.hadoop.hba > > > se > > > .util.Bytes.toBytes('col1'), > > > > > org.apache.hadoop.hbase.filter.CompareFilter::CompareOp.valueOf('EQUAL > > '),org.apache.hadoop.hbase.util.Bytes.toBytes('value1'))} > > > ROW COLUMN+CELL > > > row1 > > > column=colFammily1:col1, timestamp=1396586048561, value=value1 > > > row6 > > > column=colFammily1:col3, timestamp=1396590405939, value=value1 > > > 2 row(s) in 0.0160 seconds > > > > > > Second: When I tried same command with column value 'value2' the > > > output seems to be incorrect. > > > hbase(main):025:0> scan 'testTable', {FILTER => > > > org.apache.hadoop.hbase.filter.SingleColumnValueFilter.new(org.apache. > > > hadoop.hbase.util.Bytes.toBytes('colFammily1'),org.apache.hadoop.hba > > > se > > > .util.Bytes.toBytes('col1'), > > > > > org.apache.hadoop.hbase.filter.CompareFilter::CompareOp.valueOf('EQUAL > > '),org.apache.hadoop.hbase.util.Bytes.toBytes('value2'))} > > > ROW COLUMN+CELL > > > row2 > > > column=colFammily1:col1, timestamp=1396586054526, value=value2 > > > row2 > > > column=colFammily1:col2, timestamp=1396585985022, value=testValue > > > row6 > > > column=colFammily1:col3, timestamp=1396590405939, value=value1 > > > 2 row(s) in 0.0100 seconds > > > > > > I am not able to understand why I am getting row2 with col2 and row6 > > > in the output where in their column values are not 'value2'. > > > > > > Regards, > > > Ashish > > > > > > --047d7bf0e6cc12c19504f63554cd--