Here is an example
from 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
:

        byte[] suffix =
ByteUtil.concat(QueryConstants.SEPARATOR_BYTE_ARRAY,
SchemaUtil.getTableNameAsBytes(schemaName, tableName));
        SuffixFilter rowFilter = new SuffixFilter(suffix);
        Filter filter = new FilterList(linkFilter, rowFilter);

You can use the following method from Bytes.java (in hbase-common) to
obtain byte[] from "12345"

  public static byte[] toBytes(String s) {

Cheers

On Fri, Apr 17, 2015 at 7:50 AM, Jeetendra Gangele <[email protected]>
wrote:

> filterRowKey what is these arguments? Can you please explain lets say I
> have data like abcde_12345 similary way
> and I want to scan all the records ending with "12345" what should I pass
> to this function?
>
>
> On 16 April 2015 at 20:12, Ted Yu <[email protected]> wrote:
>
> > Please take a look
> > at
> >
> phoenix-core/src/main/java/org/apache/phoenix/coprocessor/SuffixFilter.java
> > in Phoenix repo.
> >
> > Processing is done in the following method:
> >
> >   public boolean filterRowKey(byte[] buffer, int offset, int length) {
> >
> > Note: the suffix is expressed in byte array.
> >
> > FYI
> >
> > On Thu, Apr 16, 2015 at 7:27 AM, Jeetendra Gangele <[email protected]
> >
> > wrote:
> >
> > > Thanks for your reply.Ya I am filtering on row-key which ended with
> > "12567"
> > >
> > > I did not understand properly what do you mean by "You can compose
> > > SuffixFilter which filters row key by comparing suffix."
> > >
> > > can you elaborate .
> > >
> > > On 16 April 2015 at 19:49, Ted Yu <[email protected]> wrote:
> > >
> > > > bq. record key ending with "12567"
> > > >
> > > > Can you clarify whether you're filtering by row key ?
> > > > If so, please take a look at PrefixFilter.
> > > > You can compose SuffixFilter which filters row key by comparing
> suffix.
> > > >
> > > > Cheers
> > > >
> > > > On Thu, Apr 16, 2015 at 7:06 AM, Jeetendra Gangele <
> > [email protected]
> > > >
> > > > wrote:
> > > >
> > > > > Hi All I have get all the records using scan with end with
> particular
> > > > > string let
> > > > > say record key ending with "12567". I need to scan and get all such
> > > > result.
> > > > >
> > > > > I am values filter and do the substring there but i want to avoid
> > this
> > > > > because its slow.
> > > > >
> > > > > Regards
> > > > > jeetendra
> > > > >
> > > >
> > >
> >
>

Reply via email to