Updated on 2023-04-28 GMT+08:00

Collecting Statistics on Rows

Scenario

Collect statistics on the number of rows that meet specific requirements based on the rowkey naming rule, rowkey scope, field name, and field value.

Procedure

Count the number of rows that meet the following requirements: The rowkey is in the scope from row_start to row_stop. The field name is f3:age and the field value is 25. The first two characters of the rowkey is mi.

hbase com.huawei.hadoop.hbase.tools.bulkload.RowCounter -Dcounter.rowkey.start="row_start" -Dcounter.rowkey.stop="row_stop" -Dcounter.qualifier="f3:age:25" -Dcounter.rowkey.value="substring(0,2) == 'mi'" table1
  • -Dcounter.rowkey.start="row_start": indicates that the start rowkey is row_start.
  • -Dcounter.rowkey.stop="row_stop": indicates that the end rowkey is row_stop.
  • -Dcounter.qualifier="f3:age:25": indicates that the value of column age in column family f3 is 25.
  • -Dcounter.rowkey.value="substring(0,2) == 'mi'": indicates that the first two values of the rowkey is mi.

If row_start and row_stop are specified, data whose values are greater than or equal to row_start and smaller than row_stop is counted.