Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2983

ClassCastException on auto coerce of BIGINT to DECIMAL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.8.0
    • None

    Description

      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)

      Attachments

        1. PHOENIX-2983.patch
          2 kB
          James R. Taylor
        2. PHOENIX-2983_v2.patch
          4 kB
          James R. Taylor
        3. PHOENIX-2983_v3.patch
          4 kB
          James R. Taylor

        Issue Links

          Activity

            People

              jamestaylor James R. Taylor
              jamestaylor James R. Taylor
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: