docs: missing optional error_rate parameter in APPROX_COUNT_DISTINCT documentation
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- sql
- Domain
- documentation
Research direction
Read the current documentation in docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-approx-count-distinct.md and compare it with the signature details in src/query/functions/src/aggregates/aggregate_approx_count_distinct.rs. Update the documented syntax, explain the error-rate and precision tradeoff, and add an example using APPROX_COUNT_DISTINCT(user_id, 0.05).
Written by the indexing model from the issue text.
Description
What's Missing
The APPROX_COUNT_DISTINCT aggregate function accepts an optional error rate parameter that controls the precision of the HyperLogLog estimation, but the current documentation only shows the single-argument form.
Source File
/workspace/databend/src/query/functions/src/aggregates/aggregate_approx_count_distinct.rs
What It Does
The function signature is:
APPROX_COUNT_DISTINCT(<expr> [, <error_rate>])
-- or equivalently:
APPROX_COUNT_DISTINCT(<error_rate>)(<expr>)
When error_rate is provided (a float64 value), the precision parameter p is computed as:
p = ceil(log2((1.04 / error_rate)^2))
and clamped to the range [4, 14]. The default precision is p = 14 (approximately 0.81% error rate). A higher error rate means fewer bits of precision and faster computation.
Current Documentation
/workspace/databend-docs/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-approx-count-distinct.md
The current doc only documents:
APPROX_COUNT_DISTINCT(<expr>)
Suggested Doc Location
/workspace/databend-docs/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-approx-count-distinct.md
The doc should be updated to show the optional error_rate parameter, explain the precision/accuracy tradeoff, and include an example using a custom error rate such as APPROX_COUNT_DISTINCT(user_id, 0.05).
- 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