You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Biju Nair (JIRA)" <ji...@apache.org> on 2016/03/29 22:08:25 UTC

[jira] [Updated] (PHOENIX-2808) Can't upsert valid decimal values into unsigned datatype columns

     [ https://issues.apache.org/jira/browse/PHOENIX-2808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Biju Nair updated PHOENIX-2808:
-------------------------------
    Description: 
Currently {{decimal}} values can't be {{upsert}} 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 column is 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}} 

  was:
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}} 


> 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 {{upsert}} 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 column is 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)