hbase - 将给定时间范围作为行键的 Hbase shell 命令
问题描述
我在 hbase 表中有以下数据结构,
fb60b40ce747_1552305177484 column=detail:ble_mac, timestamp=1552305177487, value=FB60B40CE747
fb60b40ce747_1552305177484 column=timeline:date_created, timestamp=1552305177487, value=1552305177484
fb60b40ce747_1552305177484 column=timeline:last_updated, timestamp=1552305177487, value=1552305177484
fb60b40ce747_1552305183307 column=detail:ble_mac, timestamp=1552305183310, value=FB60B40CE747
fb60b40ce747_1552305183307 column=timeline:date_created, timestamp=1552305183310, value=1552305183307
fb60b40ce747_1552305183307 column=timeline:last_updated, timestamp=1552305183310, value=1552305183307
fb60b40ce747_1552305194792 column=detail:ble_mac, timestamp=1552305194795, value=FB60B40CE747
fb60b40ce747_1552305194792 column=timeline:date_created, timestamp=1552305194795, value=1552305194792
fb60b40ce747_1552305194792 column=timeline:last_updated, timestamp=1552305194795, value=1552305194792
我试图通过指定时间范围来提取详细信息(即,MAC Address_TimeStamp,这是这里的关键行)。我使用了以下 hbase shell 命令,
scan 'mindlogic:ble_log',{STARTROW => 'fb60b40ce747_1552305120484', ENDROW => 'fb60b40ce747_1552305204792',LIMIT=>1}
这个命令的问题是,我无法提取最近的记录。这里最近的记录是“fb60b40ce747_1552305194792”
我尝试过另一个命令,即
scan 'mindlogic:ble_log',{LIMIT => 1,FILTER => "SingleColumnValueFilter('detail','ble_mac',=, 'binary:FB60B40CE747') AND SingleColumnValueFilter('timeline','last_updated',>=, 'binary:1552305120484') AND SingleColumnValueFilter('timeline','last_updated',<=, 'binary:1552305204792')"}
现在我的问题是,如何得到如下结果,
Expected Output :-
fb60b40ce747_1552305194792 column=detail:ble_mac, timestamp=1552305194795, value=FB60B40CE747
fb60b40ce747_1552305194792 column=timeline:date_created, timestamp=1552305194795, value=1552305194792
fb60b40ce747_1552305194792 column=timeline:last_updated, timestamp=1552305194795, value=1552305194792
解决方案
推荐阅读
- javascript - 在嵌套数组概念方面需要帮助
- python - Scrapy 不按优先级值的顺序执行请求
- javascript - 如果所有图像都具有相同的宽度,则执行某些操作
- python - 尝试每小时向频道发送消息
- python - SK-Learn 预处理流水线,垃圾输出
- c++ - 为什么我得到一个长度仅为 3 的字符串排列的输出?
- angular - 如何在 Ionic 4 中更新离子搜索栏的高度?
- c# - 如何将唯一参数传递给 Inetlab 客户端,例如数据库 ID?
- java - 尝试绘制自定义视图如何检测单击了哪个切片
- c++ - 如何将 Caesar Cipher 的元素从字符串更改为字符串