0
votes

I am trying to access a table created through Phoenix from Hbase. I am able to read the string values , but not able to read the decimal values.For e.g., DECIMAL_PLACE_CNT has actual value of 6 but from hbase shellit shows value=\xC1\x07
How can I deduce it back to 6 ?

get 'ODS.CCY',"\x00ANG"
COLUMN                                   CELL
 0:CCY_CTRY_CD                           timestamp=1470245652652, value=NL
 0:CCY_DESC                              timestamp=1470245652652, value=NETHERLANDS ANTILLIAN GUILDER
 0:CCY_RVSE_IND                          timestamp=1470245652652, value=N
 0:DECIMAL_PLACE_CNT                     timestamp=1470245652652, value=\xC1\x07
1

1 Answers

0
votes

As described here, when defined a column with type DECIMAL, Phoenix will map the value to java.math.BigDecimal.
When writing value to Hbase, Phoenix will serialize the value of java.math.BigDecimal using org.apache.phoenix.schema.types.PDataType.toBytes. The source code of this method is here, the accurate location can be found by searching static int toBytes.