1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| 代码7-25 插入数据 hbase(main):018:0> put 'student','07112001','info:name','Ben' hbase(main):019:0> put 'student','07112001','relationship:father','Bill' hbase(main):022:0> put 'student','07112001','relationship:mather','Rose' hbase(main):020:0> put 'student','07112002','info:name','Bobby' hbase(main):026:0> put 'student','07112002','relationship:father','Bert' hbase(main):023:0> put 'student','07112002','relationship:mather','Anna' hbase(main):027:0> put 'student','07112003','info:name','Jerry' hbase(main):033:0> put 'student','07112003','relationship:father','Jason' hbase(main):032:0> put 'student','07112003','relationship:mather','Lori'
代码7-26 查询表数据student hbase(main):039:0> get 'student','07112002' hbase(main):040:0> get 'student','07112002','relationship'
代码7-27 扫描student表数据 hbase(main):041:0> scan 'student'
代码7-28 统计student表记录数 hbase(main):042:0> count 'student'
代码7-29 删除列 hbase(main):044:0> delete 'student','07112003','relationship:father' hbase(main):045:0> get 'student','07112003','relationship'
代码7-30 删除RowKey为07112003的所有行 hbase(main):047:0> deleteall 'student','07112003' hbase(main):048:0> scan 'student'
代码7-31 删除表中所有的数据 hbase(main):049:0> truncate 'student'
|