圆月山庄资源网 Design By www.vgjia.com
1、首先给出本次操作的数据
create 'student','info','address' put 'student','1','info:age','20' put 'student','1','info:name','wang' put 'student','1','info:class','1' put 'student','1','address:city','zhengzhou' put 'student','1','address:area','High-tech zone' put 'student','2','info:age','21' put 'student','2','info:name','yang' put 'student','2','info:class','1' put 'student','2','address:city','beijing' put 'student','2','address:area','CBD' put 'student','3','info:age','22' put 'student','3','info:name','zhao' put 'student','3','info:class','2' put 'student','3','address:city','shanghai' put 'student','3','address:area','pudong' scan 'student'
2、首先执行,创建表,增加数据操作,执行脚本 /bin/hbase shell ./student.txt,然后查看内容 scan ‘student'
hbase(main):001:0> scan 'student' ROW COLUMN+CELL 1 column=address:area, timestamp=1491533426260, value=High-tech zone 1 column=address:city, timestamp=1491533426239, value=zhengzhou 1 column=info:age, timestamp=1491533426179, value=20 1 column=info:class, timestamp=1491533426218, value=1 1 column=info:name, timestamp=1491533426211, value=wang 2 column=address:area, timestamp=1491533426297, value=CBD 2 column=address:city, timestamp=1491533426292, value=beijing 2 column=info:age, timestamp=1491533426269, value=21 2 column=info:class, timestamp=1491533426287, value=1 2 column=info:name, timestamp=1491533426277, value=yang 3 column=address:area, timestamp=1491533426329, value=pudong 3 column=address:city, timestamp=1491533426323, value=shanghai 3 column=info:age, timestamp=1491533426305, value=22 3 column=info:class, timestamp=1491533426317, value=2 3 column=info:name, timestamp=1491533426311, value=zhao 3 row(s) in 0.1940 seconds
3、修改操作 也是用put命令,就是重新添加内容把,把以前的内容覆盖。
格式 put 't1', 'r1', 'c1', 'value'
命令 put 'student','1','info:age','18'
结果 hbase(main):010:0> get 'student','1' COLUMN CELL address:area timestamp=1491533426260, value=High-tech zone address:city timestamp=1491533426239, value=zhengzhou info:age timestamp=1491533823331, value=18 info:class timestamp=1491533426218, value=1 info:name timestamp=1491533426211, value=wang 5 row(s) in 0.0110 seconds
4、删除操作,分为删除单元格的内容,和整行删除
单元格
hbase(main):012:0> delete 'student','1','info:name' 0 row(s) in 0.0800 seconds hbase(main):014:0> get 'student','1' COLUMN CELL address:area timestamp=1491533426260, value=High-tech zone address:city timestamp=1491533426239, value=zhengzhou info:age timestamp=1491533823331, value=18 info:class timestamp=1491533426218, value=1 4 row(s) in 0.0120 seconds
整行
hbase(main):023:0> deleteall 'student','1' 0 row(s) in 0.0260 seconds hbase(main):024:0> get 'student','1' COLUMN CELL 0 row(s) in 0.0070 seconds
5、查询
单行查询
hbase(main):026:0> get 'student','2' COLUMN CELL address:area timestamp=1491533426297, value=CBD address:city timestamp=1491533426292, value=beijing info:age timestamp=1491533426269, value=21 info:class timestamp=1491533426287, value=1 info:name timestamp=1491533426277, value=yang 5 row(s) in 0.0190 seconds
指定列族
hbase(main):028:0> get 'student', '2', {COLUMN => 'info'} COLUMN CELL info:age timestamp=1491533426269, value=21 info:class timestamp=1491533426287, value=1 info:name timestamp=1491533426277, value=yang 3 row(s) in 0.0150 seconds
指定列名
hbase(main):029:0> get 'student', '2', {COLUMN => 'info:age'} COLUMN CELL info:age timestamp=1491533426269, value=21 1 row(s) in 0.0080 seconds
使用scan,指定startrow
hbase(main):031:0> scan 'student', {COLUMNS => ['info:age', 'address'], LIMIT => 10, STARTROW => '2'} ROW COLUMN+CELL 2 column=address:area, timestamp=1491533426297, value=CBD 2 column=address:city, timestamp=1491533426292, value=beijing 2 column=info:age, timestamp=1491533426269, value=21 3 column=address:area, timestamp=1491533426329, value=pudong 3 column=address:city, timestamp=1491533426323, value=shanghai 3 column=info:age, timestamp=1491533426305, value=22 2 row(s) in 0.0190 seconds
scan指定过滤
hbase(main):005:0> scan 'student',{FILTER=>"(TimestampsFilter (1491533426297))"} ROW COLUMN+CELL 2 column=address:area, timestamp=1491533426297, value=CBD 1 row(s) in 0.0170 seconds
以上这篇HBASE 常用shell命令,增删改查方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
标签:
hbase,shell,常用命令
圆月山庄资源网 Design By www.vgjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
圆月山庄资源网 Design By www.vgjia.com
暂无评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年11月09日
2024年11月09日
- 雨林唱片《赏》新曲+精选集SACD版[ISO][2.3G]
- 罗大佑与OK男女合唱团.1995-再会吧!素兰【音乐工厂】【WAV+CUE】
- 草蜢.1993-宝贝对不起(国)【宝丽金】【WAV+CUE】
- 杨培安.2009-抒·情(EP)【擎天娱乐】【WAV+CUE】
- 周慧敏《EndlessDream》[WAV+CUE]
- 彭芳《纯色角3》2007[WAV+CUE]
- 江志丰2008-今生为你[豪记][WAV+CUE]
- 罗大佑1994《恋曲2000》音乐工厂[WAV+CUE][1G]
- 群星《一首歌一个故事》赵英俊某些作品重唱企划[FLAC分轨][1G]
- 群星《网易云英文歌曲播放量TOP100》[MP3][1G]
- 方大同.2024-梦想家TheDreamer【赋音乐】【FLAC分轨】
- 李慧珍.2007-爱死了【华谊兄弟】【WAV+CUE】
- 王大文.2019-国际太空站【环球】【FLAC分轨】
- 群星《2022超好听的十倍音质网络歌曲(163)》U盘音乐[WAV分轨][1.1G]
- 童丽《啼笑姻缘》头版限量编号24K金碟[低速原抓WAV+CUE][1.1G]