IMPALA-1960: Illegal reference to non-materialized tuple when query has

an empty select-project-join block

This commit fixes an issue where an aggregation expr may reference a
non-materialized slot if the query contains an empty select-project-join
block. This fix ensures that all the exprs in an aggregation reference
materialized slots/tuples.

Change-Id: Ic2cc9818061b3f06ab1d1cebf4e604352c2df6d1
Reviewed-on: http://gerrit.cloudera.org:8080/348
Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com>
Tested-by: Internal Jenkins
This commit is contained in:
Dimitris Tsirogiannis
2015-04-20 17:06:26 -07:00
committed by Internal Jenkins
parent f22b8659fd
commit dd5ecb9deb
3 changed files with 64 additions and 8 deletions

View File

@@ -117,3 +117,15 @@ WHERE (-339.22) IN (-922.68, -254.84)
---- TYPES
INT
====
---- QUERY
# IMPALA-1960: Exprs in the aggregation that reference slots from an inline view when
# the select stmt has an empty select-project-join portion.
select sum(T.id), count(T.int_col)
from
(select id, int_col, bigint_col from functional.alltypestiny) T
where false
---- RESULTS
NULL,0
---- TYPES
BIGINT, BIGINT
====