Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> HBase thrift API - Mutation store a float in a column


Copy link to this message
-
HBase thrift API - Mutation store a float in a column
Hi,

Using the HBase thrift API, and Java as a programming language, it seems that when setting a value in a Mutation :

Mutation mutation = new Mutation();
mutation.setIsDelete(false);
 mutation.setColumn(StringUtils.bytes("data latitude"));

ByteBuffer buf = ByteBuffer.allocate(8);
mutation.setValue(buf.putFloat(12f));

The resulting value in HBase (as seen from the shell) is always:

1234##2013-05-123 03:49:13                            column=data:latitude, timestamp=1367587243318, value=\x00\x00\x00\x00

What am I doing wrong?

+
manoj p 2013-05-03, 13:31
+
Nicolas Seyvet 2013-05-03, 13:35
+
Ted Yu 2013-05-03, 13:47
+
Nicolas Seyvet 2013-05-03, 13:58
+
Ted Yu 2013-05-03, 14:13
+
Nicolas Seyvet 2013-05-03, 14:28