Biju Nair created PHOENIX-2808:
----------------------------------
Summary: Can't upsert valid decimal values into unsigned datatype
columns
Key: PHOENIX-2808
URL: https://issues.apache.org/jira/browse/PHOENIX-2808
Project: Phoenix
Issue Type: Bug
Reporter: Biju Nair
Priority: Minor
Currently {{decimal}} values can't be {{upset}} into columns defined as
unsigned datatype while it is possible if the column is defined as signed
datatype. The following is an example where the columns are defined as
{{unsigned_tinyint}} in table "unsigned_tinyint_test"
{noformat}
0: jdbc:phoenix:localhost:2181:/hbase> upsert into unsigned_tinyint_test values
(0.0);
Error: ERROR 203 (22005): Type mismatch. UNSIGNED_TINYINT and DECIMAL for 0.0
(state=22005,code=203)
{noformat}
while it is signed in "tinyint_test"
{noformat}
0: jdbc:phoenix:localhost:2181:/hbase> upsert into tinyint_test values (127.0);
1 row affected (5.168 seconds)
{noformat}
Looking at the
[code|https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/schema/types/PDecimal.java#L298],
looks like this is applicable to columns defined as
{{unsigned_int}},{{unsigned_long}},{{unsigned_small_int}},{{unsigned_tiny_int}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)