hbase sql 基本命令模板
2016-02-24 05:49
381 查看
--create table
member is table name
member_id , address , info are column family
create 'member','member_id','address,''info'
--delete column family
disable 'member'
alter 'member',{NAME='address','METHOD=''delete'}
enable 'member'
--DML
====insert
put 'member','wo','address:age' ,'26'
====update
put 'member','wo','address:age' ,'27'
--query
====select
get 'member','wo','address:age'
====select historical 'address:age' ,'26'
get 'member','wo',{COLUMN=>'address:age', TIMESTAMP=>$timestampe value of historical data}
--others:
====desc table
describe 'member'
====all table scan
scan 'member'
ROW COLUMN+CELL
shabi column=address:age, timestamp=1456263402795, value=26
shabi column=info:age, timestamp=1456263628325, value=27
shabi column=info:detials, timestamp=1456263201562, value=s25
--how to process index?
select indexed_column from table => set indexed_column as key in HBAse
select .... from table 1 table2 where table1.column = table2.column and a=? => set a as key of table1 set table1.column as key of table2
select .... from table 1 where a=? and b=? => set (a,b) as an union key
member is table name
member_id , address , info are column family
create 'member','member_id','address,''info'
--delete column family
disable 'member'
alter 'member',{NAME='address','METHOD=''delete'}
enable 'member'
--DML
====insert
put 'member','wo','address:age' ,'26'
====update
put 'member','wo','address:age' ,'27'
--query
====select
get 'member','wo','address:age'
====select historical 'address:age' ,'26'
get 'member','wo',{COLUMN=>'address:age', TIMESTAMP=>$timestampe value of historical data}
--others:
====desc table
describe 'member'
====all table scan
scan 'member'
ROW COLUMN+CELL
shabi column=address:age, timestamp=1456263402795, value=26
shabi column=info:age, timestamp=1456263628325, value=27
shabi column=info:detials, timestamp=1456263201562, value=s25
--how to process index?
select indexed_column from table => set indexed_column as key in HBAse
select .... from table 1 table2 where table1.column = table2.column and a=? => set a as key of table1 set table1.column as key of table2
select .... from table 1 where a=? and b=? => set (a,b) as an union key
相关文章推荐
- Redis代码阅读之Hacking Strings
- MySQL 数据库设计初步规范
- 大型数据库设计原则
- 数据库设计14个技巧
- 大型数据库设计原则
- 数据库索引的设计原则
- 实时数据库简介和比较---PI
- 删除MySql服务
- MySQL语法格式总结
- MySQL语法格式总结
- mongodb 学习记录
- oracle with as 用法
- PowerDesigner12 逆向工程介绍
- Hibernate Tools Oracle无法查到Table
- GoldenGate架构下oracle与oracle数据同步
- mysql中迅速插入百万条测试数据的方法
- laravel mongodb 扩展
- redis安装
- redis的配置
- redis主从