hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Meil <doug.m...@explorysmedical.com>
Subject Re: Different value of integer on querying in hbase!
Date Wed, 14 Dec 2011 13:31:44 GMT

re:  "Though hbase stores everything as string"

Not so, Hbase stores everything as bytes and you are responsible for
conversion.

http://hbase.apache.org/book.html#supported.datatypes

http://hbase.apache.org/book.html#data_model_operations




On 12/14/11 6:26 AM, "neuron005" <neuron005@gmail.com> wrote:

>
>Hii there,
>I just created a simple hbase table from my java program, Inserted value
>in
>it. But I got into an issue that whenever I store an integer value in
>habse
>and retrieve it by my java program , It gives a different value.
>For eg. 
>I inserted an int value in my hbase table '1234'
>When I queried from this using my java code -It showed a value
>892745528. 
>Though hbase stores everything as string but I casted my result as
>ResultSet rs=stmt.execute("select * from mapping_name");
>int val2=rs.getInt("val2");//val2 of type string
>
>Please help me out. Thanks in advance.
>Cheers:working:
>-- 
>View this message in context:
>http://old.nabble.com/Different-value-of-integer-on-querying-in-hbase%21-t
>p32974072p32974072.html
>Sent from the HBase User mailing list archive at Nabble.com.
>
>



Mime
View raw message