如何从与 hbase 集成的 hive table 中获取最新版本数据?

How to fetch latest version data from hive table which is integrated with hbase?

以防我的 table 在 hbase 中有 3 个版本并且我已经将蜂巢 table 集成到这个 hbase table。那么我如何只从配置单元 table 中读取最新版本的记录?

Hbase-Hive 集成 table 仅显示最新版本的记录,我们无法查询任何版本,而不是来自 hive 的最新版本 table。

当我们再次将相同的 rowkey 写入 hbase table 时,Hbase 会覆盖现有数据,如果 rowkey 不存在,则插入 table

如果你想在 hbase table 中查看旧版本,那么你需要在扫描命令中指定版本,我们需要创建(或)更改 hbase table 来存储版本。

hbase(main):> create 't2', {NAME => 'f2', VERSIONS => 10} //create table with 10 versions
hbase(main):> alter 't2',{NAME=>'f2',VERSIONS=>10} //alter already create hbase table to 10 versions
hbase(main):> scan 't2',{VERSIONS=>10} //scan hbase table for 10 versions