Hbase shell操作表
2024-09-29 15:55:33
启动hbase shell
./bin/hbase shell
1、创建表,查看表
create 'tableName', 'familykey1','familykey2',....
eg.
create 'student','info','course'
list #查看表
2、查看表信息
desc 'student'
3、 修改表结构
alter 'student',{'NAME'=>'course','VERSIONS'=>'3'}
4、insert数据到表中
table-->student rowkey-->201601 familykey:column-->info:name 4:timestamp
put 'tableName' ,'rowkey','familykey:column' ,'columnValue',timestamp eg.
put 'student','201601','info:name','liu',4
put 'student','201601','info:age',15
put 'student','201601','info:sex','nv'
put 'student','201601','info:dept','PE'
5、获取数据
get 'tableName','rowkey' eg.
get 'student','201601' #获取student表中rowkey为201601的所有列族数据
get 'student','201601','info:name' #获取student表中rowkey为201601且info列族中name的值
6、更新数据(和插入数据一样,只是少了timestamp)
put 'tableName','rowkey','familykey:column' , 'columnValue' eg.
put 'student','201601','info:name','yangwj'
7、使用scan进行查询
scan 'student',{COLUMN => 'info:dept'} #查询student表中所有列为info:dept的值 scan 'student',FILTER=>"RowFilter(=,'substring:2')" ###?????
8、表的快照
snapshot 'student','stu_snap' #创建表的快照 list_snapshots #显示所有快照表 clone_snapshot 'stu_snap','stu_info' #克隆快照从而生成新的表 delete_snapshot 'stu_snap' #删除快照
9、删除表 (先禁用表再删除)
disable 'student' #禁用表
is_disabled 'student' #查看表是否被禁用 true:禁用
drop 'student' #删除表
10、总结
完毕!
最新文章
- ajax动态添加的li不能绑定click事件
- 逐行读取txt文件,使用Linq与StreamReader的Readline方法
- 【圣诞特献】Web 前端开发精华文章推荐【系列二十一】
- android中KSOAP2中的anytype{}问题
- 普通文件迁移ASM
- [Theano] Theano初探
- 为openwrt编译xd-h3c
- 乞讨N!到底有多少0
- 简单的一句sql
- PeopleSoft底层表,闪存查找历史代码(不小心改)
- java项目word文件转html文件
- 动态获取后台传过来的值作为select选项
- 『流畅的Python』第10章笔记_序列类型
- codevs 1086 栈 2003年NOIP全国联赛普及组
- CentOS7中使用阿里云镜像
- Python爬虫个人记录(二) 获取fishc 课件下载链接
- odex文件格式
- input 和 button 的 border-box 模型和 IE8 错位
- 区间(bzoj 4653)
- Python - except不指定异常类别(转)
热门文章
- 【Flask+Redis】 python学习第一章 - 7.0 断言 数据库测试 redis学习
- WdatePicker日期控件使用与值获取,以及选择日期完毕触发事件
- opengl 4.5 中文api 链接
- 面对runc逃逸漏洞,华为云容器为您保驾护航
- 线程池中 submit()和 execute()方法有什么区别?(未完成)
- pyside pyqt QPushbuttion 无边框 stylesheet border:none
- 1114 CSS基础
- JAVA遇见HTML——JSP篇(JSP指令与动作元素)
- BZOJ 1458 / Luogu P4311 士兵占领 (上下界最小流 / 直接最大流)
- 浅谈JavaScript严格模式(use strict)