Internal Jenkins has submitted this change and it was merged. Change subject: IMPALA-3210: last/first_value() support for IGNORE NULLS ......................................................................
IMPALA-3210: last/first_value() support for IGNORE NULLS Added support for the 'ignore nulls' keyword to the last_value and first_value analytic functions, eg. 'last_value(col ignore nulls)', which would return the last value from the window that is not null, or null if all of the values in the window are null. We handle 'ignore nulls' in the FE in the same way that we handle 'distinct' - by adding isIgnoreNulls as a field in FunctionParams. To avoid affecting performance when 'ignore nulls' is not used, and to avoid having to special case 'ignore nulls' on the backend, this patch adds 'last_value_ignore_nulls' and 'first_value_ignore_nulls' builtin analytic functions that wrap 'last_value' and 'first_value' respectively. Change-Id: Ic27525e2237fb54318549d2674f1610884208e9b Reviewed-on: http://gerrit.cloudera.org:8080/3328 Reviewed-by: Thomas Tauber-Marshall <[email protected]> Tested-by: Internal Jenkins --- M be/src/exprs/aggregate-functions-ir.cc M be/src/exprs/aggregate-functions.h M fe/src/main/cup/sql-parser.cup M fe/src/main/java/com/cloudera/impala/analysis/AnalyticExpr.java M fe/src/main/java/com/cloudera/impala/analysis/FunctionCallExpr.java M fe/src/main/java/com/cloudera/impala/analysis/FunctionParams.java M fe/src/main/java/com/cloudera/impala/catalog/BuiltinsDb.java M fe/src/test/java/com/cloudera/impala/analysis/AnalyzeExprsTest.java M testdata/workloads/functional-planner/queries/PlannerTest/analytic-fns.test M testdata/workloads/functional-query/queries/QueryTest/analytic-fns.test M testdata/workloads/functional-query/queries/QueryTest/decimal.test 11 files changed, 943 insertions(+), 142 deletions(-) Approvals: Internal Jenkins: Verified Thomas Tauber-Marshall: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/3328 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic27525e2237fb54318549d2674f1610884208e9b Gerrit-PatchSet: 16 Gerrit-Project: Impala Gerrit-Branch: cdh5-trunk Gerrit-Owner: Thomas Tauber-Marshall <[email protected]> Gerrit-Reviewer: Internal Jenkins Gerrit-Reviewer: Marcel Kornacker <[email protected]> Gerrit-Reviewer: Matthew Jacobs <[email protected]> Gerrit-Reviewer: Thomas Tauber-Marshall <[email protected]>
