Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> How to use substring in Rowkey


+
Ramasubramanian Narayanan... 2012-12-27, 09:54
+
Asaf Mesika 2012-12-27, 10:07
+
Mohammad Tariq 2012-12-27, 10:16
+
Ramasubramanian Narayanan... 2012-12-27, 10:38
+
Mohammad Tariq 2012-12-27, 10:43
Copy link to this message
-
Re: How to use substring in Rowkey
There is also something called FuzzyRowFilter. It should help you out.

Regards
Ram

On Thu, Dec 27, 2012 at 4:13 PM, Mohammad Tariq <[EMAIL PROTECTED]> wrote:

> Try RowFilter with RegexStringComparator
>
> Filter filter = new RowFilter(CompareFilter.CompareOp.EQUAL,new
> RegexStringComparator("YOUR-REGEX"));
>
> Best Regards,
> Tariq
> +91-9741563634
> https://mtariq.jux.com/
>
>
> On Thu, Dec 27, 2012 at 4:08 PM, Ramasubramanian Narayanan <
> [EMAIL PROTECTED]> wrote:
>
> > Thanks a lot Tariq!!!
> >
> > Prefix is working fine...
> >
> > One more question.. in the above rowkey, if I want to select all the rows
> > which has "|home", how to do that...
> >
> > Like wise if there is a rowkey in the middle "A|B|C', how to select the
> > rows matching the "|B|" (middle column)...
> >
> > regards,
> > Rams
> >
> > On Thu, Dec 27, 2012 at 3:46 PM, Mohammad Tariq <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Hello Ram,
> > >
> > >     You can use PrefixFilter to do that.
> > > Filter filter = new PrefixFilter(Bytes.toBytes("10000000004"));
> > >
> > > Is it possible to use substring of rowkey in the where clause? I don't
> > know
> > > whether he may have home/office or any type of address..
> > > >>We don't have any 'where' clause in HBase. Also, you could end up
> with
> > RS
> > > Hotspotting with this kind of key design.
> > >
> > > Best Regards,
> > > Tariq
> > > +91-9741563634
> > > https://mtariq.jux.com/
> > >
> > >
> > > On Thu, Dec 27, 2012 at 3:37 PM, Asaf Mesika <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > You can define the StartKey of your scan object to be the customer
> > > > number (i.e. the prefix of your rowkey)
> > > > Define the end key to be the same but append a zero byte at the end
> to
> > > > signify include of the rowkey.
> > > > This should retrieve all rows starting with that customer number.
> > > >
> > > >
> > > > Sent from my iPhone
> > > >
> > > > On 27 בדצמ 2012, at 11:54, Ramasubramanian Narayanan
> > > > <[EMAIL PROTECTED]> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Suppose a rowkey contains some 5 fields delimited by "|", then how
> to
> > > use
> > > > > the same in the where clause?
> > > > >
> > > > > For example, I have some 4 customer records who is having different
> > > > number
> > > > > address .. for simplicity, I had for customer number 1,he has only
> > one
> > > > > address, for customer number 2, he has two addresses, like wise
> till
> > 4
> > > > > customer..
> > > > >
> > > > > So totally there will be 10 records in my table...
> > > > >
> > > > > Customer Number   Number of address
> > > > > Customer 1                          - 1
> > > > > Customer 2                          - 2
> > > > > Customer 3                          - 3
> > > > > Customer 4                          - 4
> > > > >                                               -----
> > > > >                                                 10
> > > > >
> > > > > *Here is my rowkey: (Customer number | Type of address)*
> > > > > 10000000001|OFFICE
> > > > > 10000000002|HOME
> > > > > 10000000002|OFFICE
> > > > > 10000000003|HOME
> > > > > 10000000003|OFFICE
> > > > > 10000000003|OTHERS
> > > > > 10000000004|HOME
> > > > > 10000000004|OFFICE1
> > > > > 10000000004|OFFICE2
> > > > > 10000000004|OTHERS
> > > > >
> > > > >
> > > > > Now question is, how to select all the details of customer 4
> > (customer
> > > > > number 10000000004)?
> > > > > Is it possible to use substring of rowkey in the where clause? I
> > don't
> > > > know
> > > > > whether he may have home/office or any type of address..
> > > > >
> > > > > Please help in providing query for the same..
> > > > >
> > > > > regards,
> > > > > Rams
> > > >
> > >
> >
>
+
Ramasubramanian Narayanan... 2013-01-18, 03:43
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB