如何从 HBase 中的某一行和某一列获取多个版本
我们知道,hbase有一个特性,就是特定的Row和特定的Column可以通过时间戳记录最近的变化值。 所以我的问题是,如何使用任何 HBase 命令列出所有更改的值?我用谷歌搜索了很多,但没有找到任何有用的链接。
As we know, hbase has a feature that a specific Row and specific Column can record recent change values by timestamps.
So my question is, HOW TO list all the changed values using any HBase command? I googled a lot, but didn't find any useful links.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
默认情况下不启用版本控制。所以你在创建表时指定了它。
此处为“个人”列启用了版本控制,但未为“学校”列启用了版本控制。
如果您描述表“对于
personal
”,则可以看到它显示
VERSIONS =>; '5'
对于school
,它显示VERSIONS =>; '1'
。如果表已经创建,则可以更改
它不显示
VERSIONS =>; '3'
按预期用于学校
。将数据放入表中。在同一单元格中输入多次。然后扫描桌子。
正如预期的那样,它显示了旧价值和新价值。
Versioning is not enabled by default. So you have specify it while creating table.
Here versioning is enabled for column "personal" but not for column 'school'
This can be seen if you describe table
For
personal
it showsVERSIONS => '5'
Forschool
it showsVERSIONS => '1'
.If table is already created it can be altered
Not it shows
VERSIONS => '3'
Forschool
as expected.Put data into table. Enter multiple times in same cell. And then scan the table.
As expected it is showing old value as well as new value.
可以使用 hbase shell 实现相同的效果:
上面将显示单元的最大 3 个版本(如果可用)。
The same can be achieved in hbase shell using:
The above will show the max 3 versions of the cell, if available.
您可以指定扫描和获取获得的版本号,它将检索它们:
You can specify the number of version you get for Scan and Get and it will retrieve them: