0

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
sel-fish
  • 4,308
  • 2
  • 20
  • 39
zebb
  • 3
  • 2

1 Answers1

0

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.

sel-fish
  • 4,308
  • 2
  • 20
  • 39
  • Thanks for your answer. Could you tell how the date type is deserialized . – zebb Sep 26 '16 at 12:14
  • @zebb I think the schema of a table is defined somewhere else beside the row data, which mean that the data type is not serialized with the value you saw. but when it parsed the data, Phoenix can get the data type from the schema and try to deserialize it to ```BigDecimal```. – sel-fish Sep 26 '16 at 14:54