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

Impala will return incorrect result on int overflow without warning

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Impala 1.3
    • Fix Version/s: None
    • Component/s: Backend

      Description

      A query that has a select item that results in an int greater than the max bigint value will be incorrect and no warning will be given to the user.

      It would be great if Impala could automatically convert the int to a float or double (which is what MySQL does) or at least warn that the value is incorrect.

      Here is an example from the random query generator. The bottom query has "1.00 * " prepended to force a float/double. This is a crazy query but the same problem could come up on a simpler query if the dataset was large enough.

      [localhost:21000] > select MIN(t2.tinyint_col_2 - t2.int_col_6 - t1.int_col_9) * SUM(t2.tinyint_col_2) * COUNT(t1.bigint_col_7) * SUM(t2.smallint_col_7 * t2.smallint_col_9) - COUNT(t2.bigint_col_5) AS col_1 FROM table_4 AS t1 LEFT JOIN table_2 AS t2 ON t2.bigint_col_10 = t1.smallint_col_4;
      Query: select MIN(t2.tinyint_col_2 - t2.int_col_6 - t1.int_col_9) * SUM(t2.tinyint_col_2) * COUNT(t1.bigint_col_7) * SUM(t2.smallint_col_7 * t2.smallint_col_9) - COUNT(t2.bigint_col_5) AS col_1 FROM table_4 AS t1 LEFT JOIN table_2 AS t2 ON t2.bigint_col_10 = t1.smallint_col_4
      +--------------------+
      | col_1              |
      +--------------------+
      | 581080169910184334 |
      +--------------------+
      Returned 1 row(s) in 0.14s
      
      
      [localhost:21000] > select 1.00* MIN(t2.tinyint_col_2 - t2.int_col_6 - t1.int_col_9) * SUM(t2.tinyint_col_2) * COUNT(t1.bigint_col_7) * SUM(t2.smallint_col_7 * t2.smallint_col_9) - COUNT(t2.bigint_col_5) AS col_1 FROM table_4 AS t1 LEFT JOIN table_2 AS t2 ON t2.bigint_col_10 = t1.smallint_col_4;
      Query: select 1.00* MIN(t2.tinyint_col_2 - t2.int_col_6 - t1.int_col_9) * SUM(t2.tinyint_col_2) * COUNT(t1.bigint_col_7) * SUM(t2.smallint_col_7 * t2.smallint_col_9) - COUNT(t2.bigint_col_5) AS col_1 FROM table_4 AS t1 LEFT JOIN table_2 AS t2 ON t2.bigint_col_10 = t1.smallint_col_4
      +------------------------+
      | col_1                  |
      +------------------------+
      | -3.130135690831522e+20 |
      +------------------------+
      Returned 1 row(s) in 0.14s
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                caseyc casey
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: