hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: ValueFilter and latest version value
Date Fri, 05 Nov 2010 04:45:51 GMT
Maybe SCVF doesn't have the setLatestVersionOnly(true) baked in?  You
want to check it out Shuja?  Might be just a simple patch adding it?

St.Ack

On Thu, Nov 4, 2010 at 1:41 PM, Shuja Rehman <shujamughal@gmail.com> wrote:
> singleColumnValueFilter require qualifier with column family but in my case,
> i just know the column family. any other hint?
>
> On Fri, Nov 5, 2010 at 1:32 AM, Debashis Saha <de.saha@gmail.com> wrote:
>
>> "s.setMaxVersions(1);" is for returning one version our of selected row. I
>> think what you are looking for is in the filter side. try
>>
>> singleColumnValueFilter.setLatestVersionOnly(true);
>>
>>
>> On Thu, Nov 4, 2010 at 1:54 PM, Shuja Rehman <shujamughal@gmail.com>
>> wrote:
>>
>> > stack,
>> >
>> > I have tried with scan also but same results, it check all the
>> values.here
>> > is the code
>> >
>> > Scan s = new Scan();
>> >         s.setStartRow(Bytes.toBytes("Name"));
>> >         s.setStopRow(Bytes.toBytes("Name"));
>> >         s.setMaxVersions(1);
>> >         s.addFamily(Bytes.toBytes("ColFam"));
>> >         Filter valFilter = new ValueFilter(CompareOp.EQUAL,new
>> > BinaryComparator(Bytes.toBytes("deactive")));
>> >
>> >      List<Filter> fs = Arrays.asList(valFilter);
>> >      Filter f3 = new FilterList(Operator.MUST_PASS_ALL, fs);
>> >      s.setFilter(f3);
>> >      ResultScanner scanner = table.getScanner(s);
>> >
>> >
>> > any other idea???
>> >
>> > On Thu, Nov 4, 2010 at 11:22 PM, Shuja Rehman <shujamughal@gmail.com>
>> > wrote:
>> >
>> > > *correction*
>> > >
>> > >  ValueFilter f1 = new ValueFilter(CompareOp.EQUAL,new
>> > > BinaryComparator(Bytes.toBytes("active")));
>> > >
>> > >
>> > > On Thu, Nov 4, 2010 at 11:21 PM, Shuja Rehman <shujamughal@gmail.com
>> > >wrote:
>> > >
>> > >> hum...i am using get at the moment and here is the code
>> > >>
>> > >>             HTable table = new HTable(config, "t1");
>> > >>             Get g = new Get(Bytes.toBytes("NameKey"));
>> > >>             g.addFamily(Bytes.toBytes("ColFam"));
>> > >>            RowFilter   f1 = new RowFilter(CompareOp.EQUAL,new
>> > >> BinaryComparator(Bytes.toBytes("active")));
>> > >>
>> > >>             g.setFilter(f1);
>> > >>             Result r = table.get(g);
>> > >>
>> > >>
>> > >> can it possible with get?
>> > >>
>> > >>
>> > >>
>> > >>
>> > >> On Thu, Nov 4, 2010 at 10:59 PM, Stack <stack@duboce.net> wrote:
>> > >>
>> > >>> Can you scan with maxversion set to 1?  Will that work?
>> > >>> St.Ack
>> > >>>
>> > >>> On Thu, Nov 4, 2010 at 10:51 AM, Shuja Rehman <shujamughal@gmail.com
>> >
>> > >>> wrote:
>> > >>> > Hi
>> > >>> >
>> > >>> > is there any option that valueFilter only check the latest
version
>> > >>> value? I
>> > >>> > want to just compare the latest version value but valueFilter
>> > compares
>> > >>> with
>> > >>> > all the version. If I use SingleColumnValueFilter then we
need to
>> > give
>> > >>> the
>> > >>> > qualifier but in my case, i just know the row key and family
name.
>> So
>> > >>> is
>> > >>> > there any other option to do this ?
>> > >>> >
>> > >>> > Thanks
>> > >>> >
>> > >>> > --
>> > >>> > Regards
>> > >>> > Shuja-ur-Rehman Baig
>> > >>> > <http://pk.linkedin.com/in/shujamughal>
>> > >>> >
>> > >>>
>> > >>
>> > >>
>> > >>
>> > >> --
>> > >> Regards
>> > >> Shuja-ur-Rehman Baig
>> > >> <http://pk.linkedin.com/in/shujamughal>
>> > >>
>> > >>
>> > >
>> > >
>> > > --
>> > > Regards
>> > > Shuja-ur-Rehman Baig
>> > > <http://pk.linkedin.com/in/shujamughal>
>> > >
>> > >
>> >
>> >
>> > --
>> > Regards
>> > Shuja-ur-Rehman Baig
>> > <http://pk.linkedin.com/in/shujamughal>
>> >
>>
>>
>>
>> --
>> - DEBASHIS SAHA
>>
>> 2519 Honeysuckle Ln
>> Rolling Meadows, IL 60008, USA
>>
>> 1-(847) 925 - 5071 (H);
>> 1-(312)-731- 6414 (M)
>> --~<O>~--
>>
>
>
>
> --
> Regards
> Shuja-ur-Rehman Baig
> <http://pk.linkedin.com/in/shujamughal>
>

Mime
View raw message