[HBase] Scan with filter by partial rowkey using HBase shell

If we have these rowkey list data.

  • xx_abc
  • xx_abc_def
  • xx_abd
  • xx_abd_rfg

To get rowkey which contain “abc”
scan 'TableName', FILTER => "RowFilter(=, 'substring:abc')"

We will get these.

  • xx_abc
  • xx_abc_def

But if we want only get “xx_abc”
scan 'TableName', FILTER => "RowFilter(=, 'substring:abc')", FILTER => "RowFilter(!=, 'substring:abc_')"

This entry was posted in HBase. Bookmark the permalink.