Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 2.5.0, Impala 2.6.0, Impala 2.7.0
-
None
Description
The IGNORE NULLS clause for the FIRST_VALUE() and LAST_VALUE() analytic functions does not work in combination with WHERE-clause subqueries that need to be rewritten into joins. Such queries fail with an analysis exception.
Reproduction:
select first_value(tinyint_col ignore nulls) over (order by id) from functional.alltypesagg t1 where exists (select 1 from functional.alltypes t2 where t1.id = t2.id) ERROR: AnalysisException: Function FIRST_VALUE_IGNORE_NULLS does not accept the keyword IGNORE NULLS.
Workaround
Manually rewrite the WHERE-clause subquery into an appropriate join.