Search code examples
hadoophbasenosql

How to retrieve information from specific rows from table in Hbase?


I have a table in Hbase and the key of this table is "user_name" + "id" for example ("username123"). I want to retrieve all rows for specific user_name for example (if i have some rows with key "john1","john2"..., i want to retrieve all rows for john) How can i do it ?


Solution

  • Use PrefixFilter. For Java API answer is here Hbase Java API: Retrieving all rows that match a Partial Row Key

    In HBase shell PrefixFilter too:

    scan 'tablename', {FILTER => "(PrefixFilter ('username'))"}