Phoenix has it's own type encodings for each data type. For best compatibility, I suggest you either use UNSIGNED_XXX [0], which are guaranteed to serialize with Bytes.toBytes(), or to use the serialization methods of PDataType types that ship in phoenix-core.
[0]: http://phoenix.apache.org/language/datatypes.html On Tue, Mar 28, 2017 at 8:37 AM, Dangi, Shailesh < [email protected]> wrote: > We have a use case to read data from an existing Phoenix tables using > HBase client APIs. > > Following are part of the key in a Phx table where TXN_BOOK_DT is of type > Date and rest VARCHAR. > ID > TXN_BOOK_DT > CR_DR_IND > PYMNT_STATUS_CD > TXN_REFR_NUM > PD_PCSOR_COD > > When reading the result row key and assuming it is separated by a zero > byte character ('\0'), I'm able to read all VARCHAR fields using > Bytes.toString. However, I'm getting garbled characters when doing the > same operation on TXN_BOOK_DT. Any idea? > > Thanks, > Regards, > >
