Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1741

Error when decimal value in WHERE clause is longer than 19 digits

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 1.4.1
    • Impala 2.0
    • Clients
    • CentOS release 6.6 (Final)

    Description

      When I try to run a query with WHERE clause and value for a column in DECIMAL data type is too long (more than 19 digits), then I get following error message:

      Error: AnalysisException: Literal '12345678901234567890' exceeds maximum range of integers. (state=HY000,code=0)

      i.e.

      Lets say we have table TTT (column VAL defined as DECIMAL(38,0)):

      VAL
      1234567890123456789
      12345678901234567890

      Then if I will run:

      select * from TTT where VAL=1234567890123456789;

      Returns correct result


      select * from TTT where VAL=12345678901234567890;

      Gives:

      Error: AnalysisException: Literal '12345678901234567890' exceeds maximum range of integers. (state=HY000,code=0)


      The only workaround I found is to cast the value:

      select * from TTT where VAL=cast(‘12345678901234567890’,DECIMAL(38,0));

      But I think this is not good.

      N.B. Hive performs casting on fly, but you need to put your value in quotes.

      Attachments

        Activity

          People

            Unassigned Unassigned
            andrey.dmitriev_impala_07e4 Andrey Dmitriev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: