Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
Impala 2.3.0, Impala 2.5.0, Impala 2.4.0, Impala 2.6.0
Description
Impala fails to properly resolve correlated column references in a BETWEEN predicate.
This is a regression from Impala 2.2, introduced in
Consider the following query with a correlated BETWEEN predicate in an IN subquery:
select 1 from functional.alltypes t1 where t1.id in (select test_id from functional.jointbl t2 where t2.test_id between t1.tinyint_col and t1.int_col) ERROR: AnalysisException: Could not resolve column/field reference: 't1.tinyint_col' select 1 from functional.alltypes t1 where t1.id in (select test_id from functional.jointbl t2 where t2.test_id between tinyint_col and int_col) ERROR: AnalysisException: Could not resolve column/field reference: 'tinyint_col'
Workaround
Rewrite the BETWEEN predicate as an explicit range condition:
select 1 from functional.alltypes t1 where t1.id in (select test_id from functional.jointbl t2 where t2.test_id >= t1.tinyint_col and t2.test_id <= t1.int_col)