You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by "Thomas Tauber-Marshall (Code Review)" <ge...@cloudera.org> on 2016/06/14 17:51:52 UTC

[Impala-CR](cdh5-trunk) IMPALA-3210: last/first value() support for IGNORE NULLS

Thomas Tauber-Marshall has uploaded a new patch set (#2).

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.

Added 'IgnoreNullsExpr', a subclass of FunctionCallExpr that is
produced by the parser when the 'ignore nulls' keyword is used.

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
---
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
A fe/src/main/java/com/cloudera/impala/analysis/IgnoreNullsExpr.java
M fe/src/main/java/com/cloudera/impala/catalog/BuiltinsDb.java
M fe/src/test/java/com/cloudera/impala/planner/PlannerTest.java
A testdata/workloads/functional-planner/queries/PlannerTest/analytic-fns-ignore-nulls.test
A testdata/workloads/functional-query/queries/QueryTest/analytic-fns-ignore-nulls.test
M tests/query_test/test_queries.py
10 files changed, 1,231 insertions(+), 41 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/28/3328/2
-- 
To view, visit http://gerrit.cloudera.org:8080/3328
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic27525e2237fb54318549d2674f1610884208e9b
Gerrit-PatchSet: 2
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Thomas Tauber-Marshall <tm...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>