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

Open Beginner friendly
#3,902 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
sql

Research direction

Start with i18n/zh-CN/.../version-2.1/sql-manual/sql-functions/scalar-functions/numeric-functions/running-difference.md and the corresponding version-3.x file, then compare the dev and version-4.x trees. Confirm the deprecated page is absent in current versions; done means removing both orphaned zh-only pages without changing unrelated documentation.

Written by the indexing model from the issue text.

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:
    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.

Dominant language
MDX
Stars
134
Forks
466
Avg merge
1d 12h
Merged PRs (30d)
60

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/doris-website

All issues in apache/doris-website

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.