docs: document mergeable population standard deviation - #2809
Conversation
Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds Nightly documentation for GreptimeDB’s mergeable population standard deviation state functions (stddev_pop_state, stddev_pop_merge, stddev_pop_calc) on the existing “Approximate Functions” reference page, including behavioral notes (NULL handling, malformed state behavior, non-finite inputs) and an end-to-end SQL example. The same content is added to both the English and Chinese Nightly docs.
Changes:
- Documented
stddev_pop_state,stddev_pop_merge, andstddev_pop_calc, including input/output types and NULL / malformed-state semantics. - Added an end-to-end SQL example that persists minute-level states, merges them, and compares the result to direct
stddev_pop. - Applied the same documentation update to both English and Chinese Nightly pages.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/reference/sql/functions/approximate.md | Adds English docs section for mergeable Welford-based stddev_pop_* state/merge/calc functions with a full SQL example. |
| i18n/zh/docusaurus-plugin-content-docs/current/reference/sql/functions/approximate.md | Adds the corresponding Chinese section and example, aligned with the English Nightly docs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Deploying greptime-docs with
|
| Latest commit: |
806fcb5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9c234bd8.greptime-docs.pages.dev |
| Branch Preview URL: | https://docs-welford-stddev.greptime-docs.pages.dev |
|
|
||
| ### `stddev_pop_state` | ||
|
|
||
| `stddev_pop_state(value)` is an aggregate function that creates a mergeable state from a `DOUBLE` expression and returns it as `BINARY`. |
There was a problem hiding this comment.
Both stddev_pop_state and stddev_pop_merge explicitly reject DISTINCT in the merged implementation (Welford DISTINCT aggregations are not available). Since these are introduced here as aggregate functions, please document this limitation and mirror it in the Chinese page; otherwise users may reasonably expect stddev_pop_state(DISTINCT value) to work.
What changed
stddev_pop_state,stddev_pop_merge, andstddev_pop_calcNULL, non-finite input, and malformed-state behaviorstddev_popaggregationThis documents the functions introduced by GreptimeTeam/greptimedb#8972.
Closes #2802
Scope
The feature is introduced for GreptimeDB 1.3.0, so released documentation versions are not changed.
Verification
pnpm buildDOC_LANG=zh pnpm buildDOC_LANG=en pnpm check:linksDOC_LANG=zh pnpm check:linksgit diff --checkChecklist