apache / apache/doris-website

[doc] running-difference is a deprecated zh-only orphan in 2.1/3.x (removed in dev/4.x); example references undefined table

Open
#3,902 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
133
Forks
464
Avg merge
1d 1h
Merged PRs (30d)
50

Description

While verifying SQL-function example pages I found `running-difference` is in an inconsistent state across versions.

**Findings**

1. **The function is deprecated** — the page itself says so ("此函数会在后续版本中废弃,推荐使用窗口函数"), and the page has been **removed entirely from `dev` and `version-4.x`** (both EN and ZH).
2. In **version-2.1** and **version-3.x** the page survives **only in Chinese** (`i18n/zh-CN/.../version-{2.1,3.x}/sql-manual/sql-functions/scalar-functions/numeric-functions/running-difference.md`) — there is no EN counterpart in those versions (only the EOL 1.2/2.0 trees have one).
3. The description's example references an **undefined table `t`**:
```sql
SELECT running_difference(x) FROM t ORDER BY k;
SELECT x - lag(x, 1, 0) OVER (ORDER BY k) FROM t;
```
These are an illustrative function-form-vs-window-form comparison (no output shown), so they aren't runnable as-is.
4. The worked example (`running_difference_test`, `BUCKETS 3`) is **documented as non-deterministic** ("结果是不稳定的", the row order used during computation may differ from the returned order), so its printed output cannot be reliably reproduced.

**Suggestion**

Since the function is deprecated and the page is already gone from dev/4.x, the cleanest fix is to **remove the orphaned zh-only `running-difference` page from version-2.1 and version-3.x** to match dev/4.x, rather than retrofit a table for a deprecated, non-deterministic example. (If keeping it is preferred, the `FROM t` snippet should be marked illustrative and the worked example reworked to be deterministic.)

Happy to open a PR removing the 2.1/3.x zh pages if that's the preferred direction.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.