【问题标题】:How to use python thrift client to scan hbase table with maxversions?如何使用 python thrift 客户端使用 maxversions 扫描 hbase 表?
【发布时间】:2012-11-27 10:31:30
【问题描述】:

全部

我现在正在尝试使用 python thrift 客户端扫描 hbase 表。 我想要的是获得扫描行的所有版本。 但是在阅读了 HBase.py 文件(可以描述为 API 规范文件)后,我找不到合适的扫描仪 API 来执行此操作。
我发现的只有:

def scannerOpenWithScan(self, tableName, scan, attributes)
def scannerOpen(self, tableName, startRow, columns, attributes)
def scannerOpenWithStop(self, tableName, startRow, stopRow, columns, attributes)
def scannerOpenWithPrefix(self, tableName, startAndPrefix, columns, attributes)
def scannerOpenTs(self, tableName, startRow, columns, timestamp, attributes)
def scannerOpenWithStopTs(self, tableName, startRow, stopRow, columns, timestamp, attributes)
def scannerOpenWithTimeRange(self, tableName, startRow, stopRow, columns, startTime, endTime)

上面提到的所有 API 都不包含任何与版本相关的参数。 也许“属性”可以做一些事情,但我不知道如何使用它。
你有什么建议吗?

【问题讨论】:

    标签: python hbase thrift


    【解决方案1】:

    很遗憾,Thrift API 不支持扫描器为同一行返回多个版本。您只能获取指定单元格的多个值。

    顺便说一句,你真的应该使用 HappyBase 而不是直接使用 Thrift。 HappyBase 让在 Python 中使用 HBase 变得更加容易。

    Happybase 也可通过Github 获得。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-21
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多