Hbase根据列和时间戳过滤行

 大姑氵娘祖茉茉_749 发布于 2022-12-07 19:28

我想使用hbase shell根据列值时间戳过滤列。例如:

f:my_qualifier  timestamp=1417542508438,  value=some value

我想返回时间戳>特定时间戳的所有列值。是否可以使用hbase shell?看来TimestampsFilter需要特定的时间戳,我认为无法使用比较器。

提前致谢!

1 个回答
  • 使用TIMERANGE选项:

    scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804, 1303668904]}
    

    看看scan命令帮助中的更多选项:

    hbase(main):001:0> scan
    
    Here is some help for this command:
    Scan a table; pass table name and optionally a dictionary of scanner
    specifications.  Scanner specifications may include one or more of:
    TIMERANGE, FILTER, LIMIT, STARTROW, STOPROW, TIMESTAMP, MAXLENGTH,
    or COLUMNS, CACHE
    
    Some examples:
    
      hbase> scan '.META.'
      hbase> scan '.META.', {COLUMNS => 'info:regioninfo'}
      hbase> scan 't1', {COLUMNS => ['c1', 'c2'], LIMIT => 10, STARTROW => 'xyz'}
      hbase> scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804, 1303668904]}
      hbase> scan 't1', {FILTER => "(PrefixFilter ('row2') AND (QualifierFilter (>=, 'binary:xyz'))) AND (TimestampsFilter ( 123, 456))"}
      hbase> scan 't1', {FILTER => org.apache.hadoop.hbase.filter.ColumnPaginationFilter.new(1, 0)}
    

    2022-12-11 02:10 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有