| 语句 | 功能 |
|---|---|
| 进入hbase客户端 | bin/hbase shell |
| 查看帮助命令 | help |
| 查看数据库 | list_namespace |
| 创建数据库 | create_namespace 'test' |
| 查看数据库下的表 | list |
| 创建表 | create 'student','info' |
| 插入数据到表 | put 'student','1001','info:sex','male' |
| 扫描查看表数据 | scan 'test:student' scan 'test:student',{STARTROW => '1001', STOPROW => '1001'} scan 'test:student',{STARTROW => '1001'} |
| 查看表结构 | describe ‘test:student’ |
| 查看“指定行”或“指定列族:列”的数据 | get 'test:student','1001' get 'test:student','1001','info:name' |
| 统计表数据行数 | count 'test:student' |
| 删除数据 | 删除某rowkey全部数据 -> deleteall 'test:student','1001' 删除某rowkey某一列数据 -> delete 'test:student','1002','info:sex' |
| 清空表数据 | truncate 'test:student' |
| 删除表 | disable 'test:student' drop 'test:student' |
| 变更表信息 | alter 'student',{NAME=>'info',VERSIONS=>3} get 'student','1001',{COLUMN=>'info:name',VERSIONS=>3} |
2.HBase的shell操作
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。