apache / apache/datafusion

decimal support for agg function

Open
#1,545 8 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
The decimal data type has been supported in #122, but in this issue #122 we just support several agg functions.
In this issue we will list some functions which are not implemented for the decimal data type.

- [x] sum https://github.com/apache/arrow-datafusion/pull/1408

- [x] min/max https://github.com/apache/arrow-datafusion/pull/1407

- [x] count/DistinctCount: don't need to implement

- [x] avg https://github.com/apache/arrow-datafusion/pull/1408

- [ ] var(col1): calculate the variance (sample) of col1

- [ ] var_samp(col1): calculate the variance (sample) of col1

- [ ] var_pop(col1): calculate the variance (population) of col1

- [ ] stddev(col1): calculate the standard deviation (sample) of col1

- [ ] stddev_samp(col1): calculate the standard deviation (sample) of col1

- [ ] stddev_pop(col1): calculate the standard deviation (population) of col1

TODO

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Research direction

Start by reading the decimal support from #122 and the existing aggregate work in PRs #1407 and #1408, then trace how sum, min/max, and avg handle decimal values. Implement decimal support for var, var_samp, var_pop, stddev, stddev_samp, and stddev_pop, and verify that each function returns the correct sample or population result.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
data-engineering, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.