如何在 hbase table 中获取旧版本行
How to get old version row in hbase table
我正在使用 Hbase,我正在尝试使用 shell 检索旧版本号并获取结果并将其作为最新版本放回 hbase table ?
scan 'TEST',{ VERSIONS => 2}
如果我犯了一些错误并想使用时间戳备份旧版本。
知道如何使用 shell 或最简单的方法吗?
扫描 : 指定版本数
scan 'mytable', {VERSIONS => 2}
获取
get 'mytable', 'myrowkey', {COLUMN => 'cf:mycol', VERSIONS => 2}
要获取特定时间,您可以使用带有时间戳的获取,如下所示
get 'mytable', 'myrowkey', {COLUMN => 'cf:mycol', VERSIONS => 2, TIMESTAMP => 123242131 }
在您要查询的时间戳范围之间,然后使用 TimeStampFilter
注:
AFAIK 从 shell 开始,没有快捷方式可以恢复旧值,而是通过再次查看 shell 中的旧值,您需要在同一行上发出 put 命令。
我正在使用 Hbase,我正在尝试使用 shell 检索旧版本号并获取结果并将其作为最新版本放回 hbase table ?
scan 'TEST',{ VERSIONS => 2}
如果我犯了一些错误并想使用时间戳备份旧版本。
知道如何使用 shell 或最简单的方法吗?
扫描 : 指定版本数
scan 'mytable', {VERSIONS => 2}
获取
get 'mytable', 'myrowkey', {COLUMN => 'cf:mycol', VERSIONS => 2}
要获取特定时间,您可以使用带有时间戳的获取,如下所示
get 'mytable', 'myrowkey', {COLUMN => 'cf:mycol', VERSIONS => 2, TIMESTAMP => 123242131 }
在您要查询的时间戳范围之间,然后使用 TimeStampFilter
注:
AFAIK 从 shell 开始,没有快捷方式可以恢复旧值,而是通过再次查看 shell 中的旧值,您需要在同一行上发出 put 命令。