Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 1.2.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.