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

Incorrect results when changing the order of aggregates in the select list with codegen enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 1.2.3
    • Impala 1.3
    • None

    Description

      With codegen enabled, correct results are observed for the following query
      (The type of tinyint_col is tinyint).

      Query: select sum(tinyint_col * tinyint_col) , count(tinyint_col) from alltypesagg
      +--------------------------------+--------------------+
      | sum(tinyint_col * tinyint_col) | count(tinyint_col) |
      +--------------------------------+--------------------+
      | 285000                         | 9000               |
      +--------------------------------+--------------------+
      

      However, the sum is calculated incorrectly when the select list is flipped:

      Query: select count(tinyint_col), sum(tinyint_col * tinyint_col) from alltypesagg
      +--------------------+--------------------------------+
      | count(tinyint_col) | sum(tinyint_col * tinyint_col) |
      +--------------------+--------------------------------+
      | 9000               | 0                              |
      +--------------------+--------------------------------+
      

      The same problem occurs when a column of type smallint is used,
      but NOT when columns of type int or bigint are used.

      With disable_codegen set to true, correct results are observed in both cases.

      Attachments

        Activity

          People

            nong_impala_60e1 Nong Li
            srinathshankar Srinath
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: