row keys through the hbase shell?

后端 未结 3 1869
遇见更好的自我
遇见更好的自我 2021-01-31 06:20

I am using

 scan \'table_name\', { COLUMNS => \'column_family:column_qualifier\', LIMIT => 2 }

to list 2 rows in a hbase table but I wou

相关标签:
3条回答
  • 2021-01-31 07:02

    A1. hbase(main):015:0> count 'table_name', INTERVAL => 1

    A2. Use RowKey filter with SubstringComparator.

    Usage :

    hbase(main):003:0> import org.apache.hadoop.hbase.filter.CompareFilter
    hbase(main):005:0> import org.apache.hadoop.hbase.filter.SubstringComparator
    hbase(main):006:0> scan 'test', {FILTER => org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new("word_by_which_you_want_to_search"))}
    
    0 讨论(0)
  • 2021-01-31 07:03

    KeyOnlyFilter - takes no arguments. Returns the key portion of each key-value pair.

    Syntax: KeyOnlyFilter ()

    0 讨论(0)
  • 2021-01-31 07:08

    Earlier solution would be:

    scan 'test', { 
      COLUMNS => ['col_family_name:col_name'], 
      FILTER => "RowFilter(=, 'substring:the_string_to_be_compared')" 
    }
    
    0 讨论(0)
提交回复
热议问题