You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Prashanth Gedde <pr...@yahoo.com> on 2014/01/07 07:08:32 UTC

Stargate - feeding numerics as byte arrays

I know that Stargate expects the values to be inserted into a HBase table to be base64 encoded.

How do I base64 encode numerical values like integer and floats before forming the JSON payload for HTTP PUT? I expect the numerics to be written as byte arrays.

Thanks
Prashanth

Re: Stargate - feeding numerics as byte arrays

Posted by Bharath Vissapragada <bh...@cloudera.com>.
Not sure if I got you right. Is this [1] what you are looking for? or this
[2] ?

[1]
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/util/Bytes.html#toBytes(int)

[2]
http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base64.html#encodeBase64(byte[])


On Tue, Jan 7, 2014 at 11:38 AM, Prashanth Gedde
<pr...@yahoo.com>wrote:

> I know that Stargate expects the values to be inserted into a HBase table
> to be base64 encoded.
>
> How do I base64 encode numerical values like integer and floats before
> forming the JSON payload for HTTP PUT? I expect the numerics to be written
> as byte arrays.
>
> Thanks
> Prashanth




-- 
Bharath Vissapragada
<http://www.cloudera.com>