James Taylor created PHOENIX-2983:
-------------------------------------

             Summary: ClassCastException on auto coerce of BIGINT to DECIMAL
                 Key: PHOENIX-2983
                 URL: https://issues.apache.org/jira/browse/PHOENIX-2983
             Project: Phoenix
          Issue Type: Bug
            Reporter: James Taylor
             Fix For: 4.8.0


0: jdbc:phoenix:localhost> CREATE TABLE LONG_BUG ("NAME" VARCHAR PRIMARY KEY, 
"AMOUNT" DECIMAL);
No rows affected (0.247 seconds)
0: jdbc:phoenix:localhost> UPSERT INTO LONG_BUG ("NAME", "AMOUNT") 
VALUES('HELLO1', -50000);
java.lang.ClassCastException: java.lang.Long cannot be cast to 
java.math.BigDecimal
at org.apache.phoenix.schema.types.PDecimal.isSizeCompatible(PDecimal.java:312)
at org.apache.phoenix.compile.UpsertCompiler$3.execute(UpsertCompiler.java:778)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:300)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:292)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:290)
at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1191)
at sqlline.Commands.execute(Commands.java:822)
at sqlline.Commands.sql(Commands.java:732)
at sqlline.SqlLine.dispatch(SqlLine.java:808)
at sqlline.SqlLine.begin(SqlLine.java:681)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:292)




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to