docs: missing documentation for SUM0 / SUM_ZERO aggregate function
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- sql
- Domain
- documentation
Research direction
Start with src/query/functions/src/aggregates/aggregator.rs and src/query/functions/src/aggregates/aggregate_sum_zero.rs to confirm the function name, alias, input type, and NULL behavior. Add the documented page at docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-sum0.md, including the provided empty-input example; it is done when SUM0 and SUM_ZERO are covered consistently with nearby aggregate-function pages.
Written by the indexing model from the issue text.
Description
Missing Documentation: SUM0 / SUM_ZERO
What is missing
The SUM0 and SUM_ZERO aggregate functions are registered in the Databend function registry but have no documentation in databend-docs.
Source code
- Registration:
/workspace/databend/src/query/functions/src/aggregates/aggregator.rs(lines 76–77) - Implementation:
src/query/functions/src/aggregates/aggregate_sum_zero.rs
What it does
SUM0 (alias: SUM_ZERO) is an aggregate function that sums UInt64 values. Unlike the standard SUM, it returns 0 instead of NULL when all input values are NULL or the group is empty. This is useful in scenarios where a zero result is semantically meaningful (e.g., counting absent events).
-- Returns 0 when there are no rows, instead of NULL
SELECT sum0(val) FROM t WHERE false;
-- ┌──────────┐
-- │ sum0(val)│
-- ├──────────┤
-- │ 0 │
-- └──────────┘
Suggested doc location
docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-sum0.md
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 44
- Avg merge
- 2d 7m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from databendlabs/databend-docs
-
Link Checker Report Openautomated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
databendlabs/databend-docs#3504 ·
-
Link Checker Report Openautomated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
databendlabs/databend-docs#3503 ·
-
auto-fix-done documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
databendlabs/databend-docs#3359 ·
-
auto-fix-done documentation
Difficulty 2/5 1-2 days Newbie friendliness 72/100
databendlabs/databend-docs#3356 ·
-
auto-fix documentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
databendlabs/databend-docs#3302 ·
All issues in databendlabs/databend-docs
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100