James Fang has posted comments on this change. Change subject: [ASTERIXDB-2459][FUN] Add sttdev_pop() aggregate function ......................................................................
Patch Set 4: (3 comments) I have moved all stddev_pop tests cases into stddev except for the mixed type test cases https://asterix-gerrit.ics.uci.edu/#/c/2997/4/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableSingleVariableStatisticsAggregateFunction.java File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableSingleVariableStatisticsAggregateFunction.java: Line 298: if (count <= 1 || aggType == ATypeTag.NULL) { > same comment. should be count <= 0, right? It is up to the implementer to choose between either returning a zero or null. I choose to return a null in this case because the standard deviation from the mean of a single data sample is 0 and not considered useful. Since I have combined both stddev and stddev_pop into one evaluator, it is better to check that the number of samples at least 2. https://asterix-gerrit.ics.uci.edu/#/c/2997/4/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractSingleVarStatisticsAggregateFunction.java File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractSingleVarStatisticsAggregateFunction.java: Line 259: if (moments.getCount() <= 1 || aggType == ATypeTag.NULL) { > should be <= 0, right? count = 1 is ok for stddev_pop because it's not subt Same as above. https://asterix-gerrit.ics.uci.edu/#/c/2997/4/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/StddevPopAggregateFunction.java File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/StddevPopAggregateFunction.java: Line 32: public class StddevPopAggregateFunction extends AbstractSingleVarStatisticsAggregateFunction { > I wonder whether we can reuse all existing stddev evaluators for stddev_pop I have changed it to a single function evaluator using a delta. -- To view, visit https://asterix-gerrit.ics.uci.edu/2997 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1732d8d70eba26e12a6e68d0e0c621491ed6b3ae Gerrit-PatchSet: 4 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: James Fang <jfang...@ucr.edu> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Dmitry Lychagin <dmitry.lycha...@couchbase.com> Gerrit-Reviewer: James Fang <jfang...@ucr.edu> Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Gerrit-HasComments: Yes