Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecFirst;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecLast;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecMax;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecMedian;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecMin;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecNonUniqueSentinel;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecStd;
Expand Down Expand Up @@ -78,6 +79,7 @@ public class JsTotalsTableConfig {
JsAggregationOperation.ABS_SUM,
JsAggregationOperation.VAR,
JsAggregationOperation.AVG,
JsAggregationOperation.MEDIAN,
JsAggregationOperation.STD,
JsAggregationOperation.FIRST,
JsAggregationOperation.LAST,
Expand Down Expand Up @@ -357,6 +359,15 @@ public AggregateRequest buildRequest(JsArray<Column> allColumns) {
agg.setColumns(columns);
break;
}
case JsAggregationOperation.MEDIAN: {
AggSpec spec = new AggSpec();
spec.setMedian(new AggSpecMedian());
columns = new AggregationColumns();
columns.setSpec(spec);
columns.setMatchPairsList(aggColumns);
agg.setColumns(columns);
break;
}
case JsAggregationOperation.STD: {
AggSpec spec = new AggSpec();
spec.setStd(new AggSpecStd());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecFirst;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecLast;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecMax;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecMedian;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecMin;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecNonUniqueSentinel;
import io.deephaven.javascript.proto.dhinternal.io.deephaven_core.proto.table_pb.aggspec.AggSpecStd;
Expand Down Expand Up @@ -217,6 +218,15 @@ public RollupRequest buildRequest(JsArray<Column> tableColumns) {
columns.setMatchPairsList(aggColumns);
break;
}
case JsAggregationOperation.MEDIAN: {
AggSpec spec = new AggSpec();
spec.setMedian(new AggSpecMedian());
columns = new AggregationColumns();
columns.setSpec(spec);
columns.setMatchPairsList(aggColumns);
agg.setColumns(columns);
break;
}
case JsAggregationOperation.STD: {
AggSpec spec = new AggSpec();
spec.setStd(new AggSpecStd());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public class JsAggregationOperation {
* "Avg".
*/
AVG = "Avg",
/**
* The median of all values in the specified column. Can only apply to numeric types. String value is
* "Median".
*/
MEDIAN = "Median",
/**
* The sample standard deviation of all values in the specified column. Can only apply to numeric types.
* String value is "Std". Sample standard deviation is computed using Bessel's correction
Expand Down Expand Up @@ -111,6 +116,7 @@ public static boolean canAggregateType(String aggregationType, String columnType
case STD: {
return isNumeric(columnType);
}
case MEDIAN:
case MIN:
case MAX: {
// Can only apply to Comparables - JS can't work this out, so we'll stick to known types
Expand Down