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

Impala accepts very big numbers but fails to store them correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • Impala 4.3.0
    • None
    • None
    • ghx-label-11

    Description

      I tried  to insert rows very big bigints, and it worked as expected with big integers (error message, no new row stored), but it didn’t work as expected with ridiculously big integers( no error message, stored incorrect value). Here are the commands used:

      drop TABLE my_first_table2;
      
      CREATE TABLE my_first_table2
      (
        id BIGINT,
        name STRING,
        PRIMARY KEY(id)
      );
      
      INSERT INTO my_first_table2 VALUES (cast(9 as BIGINT), "sarah");
      -- this works just fine as expected
      
      
      INSERT INTO my_first_table2 VALUES (cast(9999999999999999999999 as BIGINT), "sarah");
      -- ERROR: UDF ERROR: Decimal expression overflowed which is expected since it is over bigint max value (source: https://impala.apache.org/docs/build/plain-html/topics/impala_bigint.html#:~:text=Range%3A%20%2D9223372036854775808%20..,9223372036854775807. )
      
      INSERT INTO my_first_table2 VALUES (cast(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as BIGINT), "sarah");
      -- this succeeds and doesn't throw the same error as the previous command which is concerning
      
      select * from my_first_table2;
      -- there are two rows in the table, and the id is incorrect in one of them  

      Attachments

        Issue Links

          Activity

            People

              daniel.becker Daniel Becker
              abakai Bakai Ádám
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: