1. 创建表的时候必须要指定列族(student是表 info是列族)
create 'student','info'
2. 向表中加入数据(1001是行键)
put 'student', '1001','info:name','x'
put 'student', '1001','info:sex','male'
put 'student', '1001','info:age',18
put 'student', '1002','info:name','y'
put 'student', '1002','info:sex','fmale'
put 'student', '1003','info:name','z'
put 'student', '1003','info:sex','male'
3. 查看全表数据
scan 'student'
4. 查看指定范围的数据(左闭右开)
sc 'student',{STARTROW=>'1001',STOPROW=>'1003'}
6. 查看指定表的数据
get 'student', '1001', 'info:name'
7. 删除1003有关的所有信息
deleteall 'student','1003'
8. 删除1002的性别信息
delete 'student','1002','info:sex'
9. 删除表
- 先使表失联
disable 'student'
- 删除表
drop 'student'
10. 清空表数据
truncate 'student'
11. 查看该表中有几条数据(只统计rowkey)
count 'student'
12. 查看命名空间
list_namespace
13. 创建命名空间
create_namespace 'classification'
14. 查看命名空间
list_namespace
15. 在指定的命名空间创建表(必须指定列族)
create 'classification:student','info'
来源:CSDN
作者:星光不负赶路人~
链接:https://blog.csdn.net/qq_43192537/article/details/103587869