【问题标题】:Get data in a specific time interval from Cassandra DB using Hector Api使用 Hector Api 从 Cassandra DB 获取特定时间间隔内的数据
【发布时间】:2015-02-14 20:16:17
【问题描述】:

我是 cassandra 数据库的新手。我正在使用 hector api 使用 RangeSlicesQuery 从 cassandra 1.2.11 DB 中提取数据,并且我能够成功地从数据库中获取数据。我正在查询的表的主键在LexicalUUID 中,我无法将其更改为time based UUIDs,因为我的客户不允许更改数据库结构。还有一个列在该表中存储time in epoch type Integer,我想根据该时间查询数据库的特定时间间隔。谁能指导我如何使用 hector api 因为时间列不是表键?

【问题讨论】:

    标签: cassandra hector


    【解决方案1】:

    我想我可能已经找到了我的问题的答案。我还没有对此进行测试,但我想如果我使用IndexedSlicesQuery 而不是RangeSlicesQuery,因为它具有为equals, greater and less than.etc 添加表达式的特殊方法。如果其他人面临同样的问题,请查阅以下链接以获取文档和一些示例:

    Why use IndexedSlicesQuery instead of RangeSlicesQuery

    IndexedSlicesQuery Documentation

    Examples

    【讨论】:

      猜你喜欢
      • 2013-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-17
      • 1970-01-01
      相关资源
      最近更新 更多