- 1.连接hbase:hbase shell
- 2.查看表清单:list
- 3.创建表:create "employee","info"
- 4.查看表结构:describe '表名'
- 5.给表插入数据:put "employee","1001","info:sex","male"
- 6.扫描查看表数据:scan '表名'
- 7.更新指定字段的数据 :put "employee","1001","info:name","Nick"
- 8.查看“指定行”或“指定列族:列”的数据:
- get 'employee','1001' #表名 + rowkey
- get 'employee','1001','info:name' #表名 + rowkey + 列簇:字段名
- 9、统计表数据行数:count 表名
- 10、删除数据:deleteall "employee","1001"
- 11、删除某 rowkey 的某一列数据:delete "employee","1002","info:sex"
- 12、清空表数据:truncate '表名'
- 13、删除表,首先需要先让该表为 disable 状态,然后才能删除;
disable "表名"
drop "表名"