Author: Alex Behm <email@example.com>
Date: Sat Oct 15 21:35:56 2016 -0700
IMPALA-4301: Fix IGNORE NULLS with subquery rewriting.
AnayticExpr.analyze() replaces the original FIRST/LAST_VALUE
function with a FIRST/LAST_VALUE_IGNORE_NULLS function if
the IGNORE NULLS clause is specified.
The bug was that several places in AnalyticExpr.analyze() assumed
and asserted that only the original FIRST/LAST_VALUE function
could be encountered during analysis. However, with subquery
rewriting the IGNORE NULLS version of the function may also be
seen because the whole statement is re-analyzed after rewriting.
The fix is to unset the IGNORE NULLS flag of the function params
after changing the analytic function name.
Reviewed-by: Alex Behm <firstname.lastname@example.org>
Tested-by: Internal Jenkins