apache / apache/texera

Add statistical aggregate functions (MEDIAN, VARIANCE, STDDEV, MODE)

Open
#5,854 3 comments 0 reactions 1 assignee Claimed by @Musxeto View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### Feature Summary

Currently, the Aggregate operator only supports `SUM`, `COUNT`, `AVERAGE`, `MIN`, `MAX`, and `CONCAT`. It lacks common statistical aggregations such as Median, Variance, Standard Deviation, and Mode. Adding these functions will provide data scientists with more powerful statistical tools out-of-the-box when building workflows.

### Proposed Solution or Design

1. Add `MEDIAN`, `VARIANCE`, `STDDEV`, and `MODE` to `AggregationFunction.java`.
2. Implement the computation logic for these functions in `AggregationOperation.scala` (and any related distributed aggregation classes).
3. Update the frontend UI schema for the Aggregate operator to reflect the new options.
4. Add comprehensive unit tests in `AggregateOpSpec.scala` covering positive, negative, and edge cases.

### Affected Area

Workflow Engine (Amber), Workflow UI

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.