You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Frank Liu <ma...@163.com> on 2011/06/13 07:34:37 UTC
problem of php visit hbase via Thrift
HI,
we met a problem of php visiting Hbase via thrift. we can access hbase via php.
But it looks php can only work correct with String. As long as the data stored in
Hbase is non-String, like integer, float, etc, php can't get the correct value. All
value returned is unreadable.
Any ideas for this problem?
Thanks!
Frank Liu
Re: problem of php visit hbase via Thrift
Posted by Jeff Whiting <je...@qualtrics.com>.
Everything in hbase is stored as a binary array of data and it is up to the application to
understand that data. In php strings are effectively binary arrays of bytes. So to store other
types of data I would look at pack and unpack to produce binary int, longs, doubles, etc.
If you want to If only php is talking to hbase you could use serialize and unserialize to store
whatever data you want--I wouldn't as I would want a more universal format. Or json_encode and
json_decode if you want to store json in hbase.
~Jeff
On 6/12/2011 11:34 PM, Frank Liu wrote:
> HI,
>
>
> we met a problem of php visiting Hbase via thrift. we can access hbase via php.
> But it looks php can only work correct with String. As long as the data stored in
> Hbase is non-String, like integer, float, etc, php can't get the correct value. All
> value returned is unreadable.
>
>
> Any ideas for this problem?
> Thanks!
>
>
> Frank Liu
--
Jeff Whiting
Qualtrics Senior Software Engineer
jeffw@qualtrics.com