Skip to content

docs: add anomaly detection window functions reference (EN + ZH)#2343

Merged
evenyag merged 4 commits intomainfrom
copilot/update-docs-anomaly-scores
Mar 5, 2026
Merged

docs: add anomaly detection window functions reference (EN + ZH)#2343
evenyag merged 4 commits intomainfrom
copilot/update-docs-anomaly-scores

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 25, 2026

Documents the three statistical anomaly-scoring window functions added in GreptimeTeam/greptimedb#7681.

What's Changed in this PR

New docs/reference/sql/functions/anomaly.md (EN + ZH) covering:

  • anomaly_score_zscore(val) — Z-Score: |x − mean| / stddev, min 2 samples
  • anomaly_score_mad(val) — MAD: |x − median| / (MAD × 1.4826), min 3 samples
  • anomaly_score_iqr(val, k) — IQR/Tukey Fences: distance beyond Q1−k×IQR / Q3+k×IQR, min 3 samples

Each function documents signature, formula, minimum sample requirements, and degenerate-case behavior (NULL / 0.0 / +inf). Page includes a full end-to-end example and subquery pattern for filtering anomalous rows:

SELECT * FROM (
    SELECT host, ts, val,
        ROUND(anomaly_score_mad(val) OVER (
            PARTITION BY host ORDER BY ts
            ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
        ), 2) AS mad
    FROM sensor_data
) WHERE mad > 3.0;
  • Linked from functions/overview.md (EN + ZH)
  • Added reference/sql/functions/anomaly to sidebars.ts

Checklist

  • Please confirm that all corresponding versions of the documents have been revised.
  • Please ensure that the content in sidebars.ts matches the current document structure when you changed the document structure.
  • This change requires follow-up update in localized docs.
Original prompt

This section details on the original issue you should resolve

<issue_title>Update docs for feat: implements anomaly_score_iqr, anomaly_score_mad etc.</issue_title>
<issue_description>A document change request is generated from GreptimeTeam/greptimedb#7681</issue_description>

<agent_instructions>Write the documents for this PR GreptimeTeam/greptimedb#7681, including chinese and en version in nightly.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 25, 2026

Deploying greptime-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7844158
Status: ✅  Deploy successful!
Preview URL: https://439472ff.greptime-docs.pages.dev
Branch Preview URL: https://copilot-update-docs-anomaly.greptime-docs.pages.dev

View logs

Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation for anomaly score features docs(nightly): add anomaly detection window functions reference (EN + ZH) Feb 25, 2026
Copilot AI requested a review from killme2008 February 25, 2026 08:44
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
@killme2008 killme2008 marked this pull request as ready for review March 3, 2026 04:02
@killme2008 killme2008 requested a review from fengjiachun as a code owner March 3, 2026 04:02
Copy link
Copy Markdown
Member

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@killme2008 killme2008 changed the title docs(nightly): add anomaly detection window functions reference (EN + ZH) docs: add anomaly detection window functions reference (EN + ZH) Mar 3, 2026
@evenyag evenyag merged commit ef5ad92 into main Mar 5, 2026
6 checks passed
@evenyag evenyag deleted the copilot/update-docs-anomaly-scores branch March 5, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs for feat: implements anomaly_score_iqr, anomaly_score_mad etc.

4 participants