You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Néstor Boscán <ne...@gmail.com> on 2014/11/25 02:19:03 UTC
Can I use the Thrift API to scan with filters?
Hi
I've been searching for Thrift Java API examples with filters but can't
find any. Does the current Thrift API supports it?
Regards,
Néstor
Re: Can I use the Thrift API to scan with filters?
Posted by Néstor Boscán <ne...@gmail.com>.
Hi
Thanks for the quick replies.
I've tried to apply the filters but I get in the Thrift server log screen:
SingleColumnValueFilter('familycolumn', 'column', =, 'value') => Invalid
comparator
SingleColumnValueFilter('familycolumn', 'column', EQUAL, 'value') =>
Invalid comparator
SingleColumnValueFilter('familycolumn', 'column', 'EQUAL', 'value') =>
Invalid comparator
SingleColumnValueFilter('familycolumn', 'column',
CompareFilter::CompareOp.valueOf('EQUAL'), 'value') => Expected 4 or 6 but
got: 3
SingleColumnValueFilter(Bytes.toBytes('familycolumn'),
Bytes.toBytes('column'), CompareFilter::CompareOp.valueOf('EQUAL'),
Bytes.toBytes('value')) => Expected 4 or 6 but got: 1
I couldn't find on the Internet an example of a SingleColumnValueFilter
with the Thrift Java API.
Regards,
Néstor
On Mon, Nov 24, 2014 at 10:20 PM, Stack <st...@duboce.net> wrote:
> On Mon, Nov 24, 2014 at 6:06 PM, Bharath Vissapragada <
> bharathv@cloudera.com
> > wrote:
>
> > Yes, you can. Did you try the scannerOpenWithScan() call? It takes a
> TScan
> > as input and you can build it with a filterString. Closest examples I
> could
> > find are [1] and [2] but I believe its not difficult to extend these.
> >
> > [1]
> >
> >
> https://github.com/apache/hbase/blob/master/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java#L540
> > [2]
> >
> >
> https://github.com/apache/hbase/blob/master/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/DemoClient.java#L64
>
>
>
> To add to @Bharath's answer, see http://hbase.apache.org/book.html#thrift
>
> St.Ack
>
>
>
> >
> >
> > On Tue, Nov 25, 2014 at 6:49 AM, Néstor Boscán <ne...@gmail.com>
> wrote:
> >
> > > Hi
> > >
> > > I've been searching for Thrift Java API examples with filters but can't
> > > find any. Does the current Thrift API supports it?
> > >
> > > Regards,
> > >
> > > Néstor
> > >
> >
> >
> >
> > --
> > Bharath Vissapragada
> > <http://www.cloudera.com>
> >
>
Re: Can I use the Thrift API to scan with filters?
Posted by Stack <st...@duboce.net>.
On Mon, Nov 24, 2014 at 6:06 PM, Bharath Vissapragada <bharathv@cloudera.com
> wrote:
> Yes, you can. Did you try the scannerOpenWithScan() call? It takes a TScan
> as input and you can build it with a filterString. Closest examples I could
> find are [1] and [2] but I believe its not difficult to extend these.
>
> [1]
>
> https://github.com/apache/hbase/blob/master/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java#L540
> [2]
>
> https://github.com/apache/hbase/blob/master/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/DemoClient.java#L64
To add to @Bharath's answer, see http://hbase.apache.org/book.html#thrift
St.Ack
>
>
> On Tue, Nov 25, 2014 at 6:49 AM, Néstor Boscán <ne...@gmail.com> wrote:
>
> > Hi
> >
> > I've been searching for Thrift Java API examples with filters but can't
> > find any. Does the current Thrift API supports it?
> >
> > Regards,
> >
> > Néstor
> >
>
>
>
> --
> Bharath Vissapragada
> <http://www.cloudera.com>
>
Re: Can I use the Thrift API to scan with filters?
Posted by Bharath Vissapragada <bh...@cloudera.com>.
Yes, you can. Did you try the scannerOpenWithScan() call? It takes a TScan
as input and you can build it with a filterString. Closest examples I could
find are [1] and [2] but I believe its not difficult to extend these.
[1]
https://github.com/apache/hbase/blob/master/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java#L540
[2]
https://github.com/apache/hbase/blob/master/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/DemoClient.java#L64
On Tue, Nov 25, 2014 at 6:49 AM, Néstor Boscán <ne...@gmail.com> wrote:
> Hi
>
> I've been searching for Thrift Java API examples with filters but can't
> find any. Does the current Thrift API supports it?
>
> Regards,
>
> Néstor
>
--
Bharath Vissapragada
<http://www.cloudera.com>