可以使用count命令计算表的行数量。它的语法如下:
count ‘<table name>’ |
hbase(main):023:0> count 'emp' |
2 row(s) in 0.090 seconds |
=> 2 |
此命令将禁止删除并重新创建一个表。truncate 的语法如下:
hbase> truncate 'table name' |
hbase(main):011:0> truncate 'emp' |
Truncating 'one' table (it may take a while): |
- Disabling table... |
- Truncating table... |
0 row(s) in 1.5950 seconds |
hbase(main):017:0> scan ‘emp’ |
ROW COLUMN+CELL |
0 row(s) in 0.3110 seconds |