Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
Impala 1.3, Impala 2.0, Impala 2.2, Impala 2.3.0
Description
MySQL and Postgresql agree that the result of
SELECT 1 FROM non_empty_table HAVING COUNT > 0
should be a single row with the value 1. However impala returns a 1 for each row in the table.
The explain plan shows the aggregate and predicate are not considered.
[localhost:21000] > explain select 1 from tinytable having count(*) > 0; Query: explain select 1 from tinytable having count(*) > 0 +----------------------------------------------------------+ | Explain String | +----------------------------------------------------------+ | Estimated Per-Host Requirements: Memory=32.00MB VCores=1 | | | | 01:EXCHANGE [PARTITION=UNPARTITIONED] | | | | | 00:SCAN HDFS [functional.tinytable] | | partitions=1/1 size=76B | +----------------------------------------------------------+ Returned 6 row(s) in 0.02s mysql> select 1 from table_1 having count(*) > 0; +---+ | 1 | +---+ | 1 | +---+ 1 row in set (0.00 sec) randomness=# select 1 from table_1 having count(*) > 0; ?column? ---------- 1 (1 row)