RE: HBase thrift API - Mutation store a float in a column

2013-05-03 Thread Nicolas Seyvet
Cool. Thanks a lot. -Original Message- From: Ted Yu [mailto:yuzhih...@gmail.com] Sent: Friday, May 03, 2013 4:13 PM To: user@hbase.apache.org Subject: Re: HBase thrift API - Mutation store a float in a column Nicolas: I think Java client should be able to read this float - after

Re: HBase thrift API - Mutation store a float in a column

2013-05-03 Thread Ted Yu
Nicolas: I think Java client should be able to read this float - after conversion. Cheers On Fri, May 3, 2013 at 6:58 AM, Nicolas Seyvet wrote: > Hi, > > Thanks Ted. > > I think you mean to use flip() in order to pre-dispose the buffer for read > (ie a get). if I use flip() after generating the

RE: HBase thrift API - Mutation store a float in a column

2013-05-03 Thread Nicolas Seyvet
Hi, Thanks Ted. I think you mean to use flip() in order to pre-dispose the buffer for read (ie a get). if I use flip() after generating the ByteBuffer then my data gets to be stored in the row. ByteBuffer buf = ByteBuffer.allocate(8); buf.putFloat(12f) buf.flip(); mutation.setValue(buf); w

Re: HBase thrift API - Mutation store a float in a column

2013-05-03 Thread Ted Yu
the resulting is always =\x00\x00\x00\x00 > > Even if I put something bigger or smaller. > > -Original Message- > From: manoj p [mailto:eors...@gmail.com] > Sent: Friday, May 03, 2013 3:31 PM > To: user@hbase.apache.org > Subject: Re: HBase thrift API - Mutation store a

RE: HBase thrift API - Mutation store a float in a column

2013-05-03 Thread Nicolas Seyvet
The initial value is 12.0, the resulting is always =\x00\x00\x00\x00 Even if I put something bigger or smaller. -Original Message- From: manoj p [mailto:eors...@gmail.com] Sent: Friday, May 03, 2013 3:31 PM To: user@hbase.apache.org Subject: Re: HBase thrift API - Mutation store a float

Re: HBase thrift API - Mutation store a float in a column

2013-05-03 Thread manoj p
HBase stores values as byte arrays. When a float value is converted to byte, there is a possibility of data truncation. I guess the precision loss that happens due to data truncation might be the reason for getting the same value 0 repeatedly. BR/Manoj

HBase thrift API - Mutation store a float in a column

2013-05-03 Thread Nicolas Seyvet
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.setV