简体   繁体   中英

Search for row keys with spaces without space using Hbase filters

I am trying to fetch the rows from Hbase table using RowFilter.

I have a hbase table with data as mentioned below

RowKey
krm south tower
krm north tower                 

If I give "krm" or "krm south" as input to the RowFilter I get the respective records.

RowFilter(=,'binaryprefix:krm') or RowFilter(=,'binaryprefix:krm south')

When I pass "krmsouth"(without spaces) to the filter, it returns me empty records.

RowFilter(=,'binaryprefix:krmsouth')

I need to get the corresponding values of krm south tower if "krmsouth" is passed to the filter. Is there a way to achieve this?

The simplest answer is that your row keys really shouldn't have spaces. If you absolutely need row keys with spaces, you'll have to write your own code that runs the query with and without spaces. Alternately you can write a Coprocessor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM