Hbase多版本(version)数据写入和读取

1. 首先创建一个支持多版本的hbase表

create 'dsi2018s03:testVersion',{NAME => 'f1', VERSIONS => 2}
 

2.put几条测试数据

put 'dsi2018s03:testVersion','10001','f1:name','jack1'
put 'dsi2018s03:testVersion','10001','f1:name','jack2'

3.读取多版本数据

get方式
get 'dsi2018s03:testVersion','10001',{VERSIONS => 2}
 
scan方式
scan 'dsi2018s03:testVersion',{VERSIONS => 2}

猜你喜欢

转载自www.cnblogs.com/dtmobile-ksw/p/11371510.html
今日推荐