impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Tauber-Marshall (Code Review)" <>
Subject [Impala-CR](cdh5-trunk) IMPALA-3210: last/first value() support for IGNORE NULLS
Date Mon, 27 Jun 2016 18:28:26 GMT
Thomas Tauber-Marshall has uploaded a new patch set (#4).

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'

This patch also removes 'first_value_rewrite' - this was a minor
performance improvement for certain special cases of first_value,
but it significantly complicates the code, and isn't compatible
with 'ignore nulls'.

Change-Id: Ic27525e2237fb54318549d2674f1610884208e9b
M be/src/exec/
M be/src/exec/analytic-eval-node.h
M be/src/exprs/
M be/src/exprs/aggregate-functions.h
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/com/cloudera/impala/analysis/
M fe/src/main/java/com/cloudera/impala/analysis/
M fe/src/main/java/com/cloudera/impala/analysis/
M fe/src/main/java/com/cloudera/impala/catalog/
M fe/src/main/java/com/cloudera/impala/planner/
M fe/src/test/java/com/cloudera/impala/planner/
A testdata/workloads/functional-planner/queries/PlannerTest/analytic-fns-ignore-nulls.test
M testdata/workloads/functional-planner/queries/PlannerTest/analytic-fns.test
A testdata/workloads/functional-query/queries/QueryTest/analytic-fns-ignore-nulls.test
M testdata/workloads/functional-query/queries/QueryTest/analytic-fns.test
M tests/query_test/
16 files changed, 1,189 insertions(+), 229 deletions(-)

  git pull ssh:// refs/changes/28/3328/4
To view, visit
To unsubscribe, visit

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic27525e2237fb54318549d2674f1610884208e9b
Gerrit-PatchSet: 4
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Thomas Tauber-Marshall <>
Gerrit-Reviewer: Matthew Jacobs <>
Gerrit-Reviewer: Thomas Tauber-Marshall <>

View raw message