[ https://issues.apache.org/jira/browse/PHOENIX-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14346339#comment-14346339
]
James Taylor commented on PHOENIX-1695:
---------------------------------------
Yes, that's the "suboptimal" aspect of the HBase Bytes utility methods. My recommendation
would be to use the PDataType serialization methods instead.
> Phoenix matching the HBase Bytes.toBytes(int) method cause numerical overflow
> -----------------------------------------------------------------------------
>
> Key: PHOENIX-1695
> URL: https://issues.apache.org/jira/browse/PHOENIX-1695
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.2
> Environment: HBase-0.98+Phoenix-4.2
> Reporter: q79969786
>
> 1. Put data like below:
> HTableInterface tableOrder = connection.getTable(newTableName);
> List<Put> puts = new ArrayList<Put>();
> Put put1 = new Put(Bytes.toBytes("1"));
> put1.add(DEFAULT_CF, Bytes.toBytes("ID"), Bytes.toBytes(3));
> put1.add(DEFAULT_CF, Bytes.toBytes("NAME"), Bytes.toBytes("Positive"));
> puts.add(put1);
> Put put2 = new Put(Bytes.toBytes("2"));
> put2.add(DEFAULT_CF, Bytes.toBytes("ID"), Bytes.toBytes(-3));
> put2.add(DEFAULT_CF, Bytes.toBytes("NAME"), Bytes.toBytes("Negative"));
> puts.add(put2);
> tableOrder.put(puts);
> 2. Map table as below:
> CREATE VIEW T_PC_ORDER30 ( PK VARCHAR PRIMARY KEY, CF.ID INTEGER, CF.NAME VARCHAR );
> 3.Select data as below
> SELECT * FROM T_PC_ORDER30;
> But the result is:
> 1 -2147483645 Positive
> 2 2147483645 Negative
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
|