hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Smith <stu24m...@yahoo.com>
Subject Re: Different value of integer on querying in hbase!
Date Wed, 14 Dec 2011 17:32:18 GMT
Hello,
  How did you query base via a statement object? Are you using Hive? 

Or is this some new interface I don't know about.. I always had to use Get() or Scan().
And hbase stores everything as bytes, not strings.. unlike C, in java, there is a difference
;)

Take care,
 -stu




________________________________
 From: neuron005 <neuron005@gmail.com>
To: hbase-user@hadoop.apache.org 
Sent: Wednesday, December 14, 2011 3:26 AM
Subject: Different value of integer on querying in hbase!
 

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-tp32974072p32974072.html
Sent from the HBase User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message