You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Zebra Zhao <ze...@gmail.com> on 2011/11/26 05:06:17 UTC
How to retrieve qualifier information from TRowResult in
Thrift(v0.80) Hbase(v0.90) Php
Hi All,
I created a Hbase table with following schema:
<row_id> --> {<cf_id>: [<qualifier_id1>,<qualifier_id2>,...]}
Row record sample:
<"00001"> {<"cf_01">:<"qualifier_01">,<"qualifier_02">,...]}
I wrote following code to retrieve the all the qualifier name associated
with one TRowResult. Here is the code:
$rowKey = "00001";
$rowResults = $client->getRow($tableName,$rowKey);
foreach ($rowResults as $rowresult){
if ($rowresult->row){
echo( "row: {$rowresult->row}, cols: \n" );
$values = $rowresult->columns;
asort( $values );
foreach ( $values as $k=>$v ) {
echo( " {$k} => {$v->value}\n" );
}//foreach
}//if
}//foreach
However, the output didnot show any qualifier name:
row: 00001, cols:
cf_01 =>
My question is how to retrieve the qualifier information from a TRowResult.
Specifically, how to get "qualifier_01","qualifier_02" using above code.
I've looked up the Hbase.php Hbase_type.php, but did not find the useful
information.
Any suggestion will be appreciated.
Thank you,
Zhao
Re: How to retrieve qualifier information from TRowResult in
Thrift(v0.80) Hbase(v0.90) Php
Posted by Bryan Duxbury <br...@rapleaf.com>.
This is a question for the HBase user list, not Thrift's.
On Fri, Nov 25, 2011 at 8:06 PM, Zebra Zhao <ze...@gmail.com> wrote:
> Hi All,
>
> I created a Hbase table with following schema:
>
> <row_id> --> {<cf_id>: [<qualifier_id1>,<qualifier_id2>,...]}
>
> Row record sample:
>
> <"00001"> {<"cf_01">:<"qualifier_01">,<"qualifier_02">,...]}
>
> I wrote following code to retrieve the all the qualifier name associated
> with one TRowResult. Here is the code:
>
> $rowKey = "00001";
> $rowResults = $client->getRow($tableName,$rowKey);
>
> foreach ($rowResults as $rowresult){
> if ($rowresult->row){
> echo( "row: {$rowresult->row}, cols: \n" );
> $values = $rowresult->columns;
> asort( $values );
>
> foreach ( $values as $k=>$v ) {
> echo( " {$k} => {$v->value}\n" );
> }//foreach
> }//if
> }//foreach
>
> However, the output didnot show any qualifier name:
> row: 00001, cols:
> cf_01 =>
>
> My question is how to retrieve the qualifier information from a TRowResult.
> Specifically, how to get "qualifier_01","qualifier_02" using above code.
> I've looked up the Hbase.php Hbase_type.php, but did not find the useful
> information.
> Any suggestion will be appreciated.
>
> Thank you,
> Zhao
>