impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Jacobs (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4738: STDDEV SAMP should return NULL for single record input
Date Thu, 26 Jan 2017 19:49:47 GMT
Matthew Jacobs has posted comments on this change.

Change subject: IMPALA-4738: STDDEV_SAMP should return NULL for single record input
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/5800/1/be/src/exprs/aggregate-functions-ir.cc
File be/src/exprs/aggregate-functions-ir.cc:

PS1, Line 1348: DoubleVal AggregateFunctions::KnuthStddevFinalize(FunctionContext* ctx,
              :     const StringVal& state_sv) {
              :   DCHECK(!state_sv.is_null);
              :   DCHECK_EQ(state_sv.len, sizeof(KnuthVarianceState));
              :   KnuthVarianceState* state = reinterpret_cast<KnuthVarianceState*>(state_sv.ptr);
              :   if (state->count == 0 || state->count == 1) return DoubleVal::null();
              :   re
> STDDEV is an alias for STDDEV_SAMP according the impala documentation. Shou
If that's the case, though it is concerning Oracle's behavior differs. I see postgres does
just alias them, so I guess that's fine as long as we're clear in the docs. Thanks for checking
that.


http://gerrit.cloudera.org:8080/#/c/5800/1/testdata/workloads/functional-query/queries/QueryTest/aggregation.test
File testdata/workloads/functional-query/queries/QueryTest/aggregation.test:

PS1, Line 26: SELECT variance(tinyint_col), stddev(smallint_col), variance_pop(int_col),
            : stddev_pop(bigint_col)
please add a col for stddev_samp as well. even though they're aliased now, let's make sure
we cover both fns anyway for the future.


-- 
To view, visit http://gerrit.cloudera.org:8080/5800
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ide8af752cd8a2e554a2cd5a1ec948967a80de1fe
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: anujphadke <aphadke@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj@cloudera.com>
Gerrit-Reviewer: anujphadke <aphadke@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message