Hbase(2)——基础语句(2)

2020-11-11 17:02:11 浏览数 (1)

(1)创建含namespace的表: 上一节我们创建的basketball表存在了default中,但是我们要是想将表存在我们建的‘hbase_test’中,那么我们就需要用到如下语法:

(2)插入数据:

代码语言:javascript复制
put 'hbase_test:basketball1','Texas','team:spur','1'
put 'hbase_test:basketball1','Texas','team:Mavericks','2'
put 'hbase_test:basketball1','Texas','team:rockets','3'
put 'hbase_test:basketball1','California','team:Lakers','1'
put 'hbase_test:basketball1','California','team:KINGS','2'
put 'hbase_test:basketball1','California','team:Clippers','3'
put 'hbase_test:basketball1','California','team:Warriors','3'

(3)查看表scan:

(4)修改数据: 直接改即可,对应的时间戳也会改变,相当于一个新的版本

(5)根据rowkey查询:

可见,将California为rowkey的四支球队全部查出 (6)查具体值:

(7)查多个列族:

(8)删除某一列族:

0 人点赞