dspvin19712 2012-06-13 13:04
浏览 170
已采纳

PHP Hbase Thrift客户端返回数组而不是TRowResult

We are using the Thrift client to access Hbase from PHP. Hbase version is hbase-0.90.4-cdh3u3.

My problem (well, it's more like a doubt) is that the Thrift API is supposed to return TRowResult for a number of methods, for example: scannerGet, getRowWithColumns... Instead, it returns an array with a single TRowResult instance.

Does anyone know why is that? Is there any case when these methods - that typically are supposed to return a single row or none - return more than one TRowResult instances? Can I simply pop this one row in my wrapper class and return it instead of returning the array (or null if there's empty array)?

The .thrift documentation is pretty clear about what is supposed to be returned:

/** 
 * Get the specified columns for the specified table and row at the latest
 * timestamp. Returns an empty list if the row does not exist.
 * 
 * @return TRowResult containing the row and map of columns to TCells
 */
list<TRowResult> getRowWithColumns(

[...]

/**
 * Returns the scanner's current row value and advances to the next
 * row in the table.  When there are no more rows in the table, or a key
 * greater-than-or-equal-to the scanner's specified stopRow is reached,
 * an empty list is returned.
 *
 * @return a TRowResult containing the current row and a map of the columns to TCells.
 *
 * @throws IllegalArgument if ScannerID is invalid
 *
 * @throws NotFound when the scanner reaches the end
 */
list<TRowResult> scannerGet(

(Although @throws NotFound is obsolete)

Thanks!

  • 写回答

1条回答 默认 最新

  • duankanjian4642 2012-06-14 10:58
    关注

    There are getRows() and scannerGetList() methods, which returns array of TRowResult objects. I used hbase from cdh3u4, don't know if theese methods exists in cdh3u3. BTW, cdh4 should already containn hbase 0.92 and support scan filters ;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?