phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Johnson <matt.john...@algomi.com>
Subject BigDecimal casting issue?
Date Thu, 26 Feb 2015 11:06:55 GMT
Hi all,



I am trying to map an HBase column where I store java.math.BigDecimal
values using:



*Bytes.toBytes(myBigDecimalValueInJava)*



My understanding from the “Data Types” page (
http://phoenix.apache.org/language/datatypes.html#decimal_type) is that the
DECIMAL type in Phoenix should map to this. However, when I store:



*102.1*



in HBase, Phoenix reads it back as:



*-1.02020201E+126*



Not sure whether I am using it wrong? I have tried creating the view with
data type DECIMAL and also DECIMAL(15,5) but both give the same problem. Is
anyone else able to successfully insert BigDecimal values via the HBase
client and retrieve them using Phoenix?



FYI when I retrieve the value using HBase client:



*BigDecimal bd = Bytes.toBigDecimal(value);*



It correctly prints the value of 102.1.



Any thoughts?



Cheers,

Matt

Mime
View raw message