Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
Impala 2.1.1
-
None
Description
In the query below, it appears we incorrectly substitute the "timestamp_col" SlotRef within the extract() function with the expr that has the select-list alias "timestamp_col" (i.e., the extract() function itself).
extract() returns an INT.
select extract(timestamp_col, 'hour') AS timestamp_col, string_col,
sum(double_col) AS double_total
FROM functional.alltypes
GROUP BY 1, 2
ERROR: AnalysisException: No matching function with signature: extract(INT, STRING).
Another manifestation of this same bug:
create database wes; create table wes.airlines_parquet (cancelled tinyint) stored as parquet; insert into wes.airlines_parquet values(1), (2), (3), (NULL), (0), (-1); select cast(cancelled as boolean) as `cancelled`, count(*) as `count` from wes.`airlines_parquet` group by 1; ERROR: AnalysisException: select list expression not produced by aggregation output (missing from GROUP BY clause?): CAST(cancelled AS BOOLEAN)