This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 9b53ce745a9 [fix](doc) dense-rank.md: add missing int_t setup; rewrite 
malformed result block (#3821)
9b53ce745a9 is described below

commit 9b53ce745a9a2ccb62d1800a9060d9432286012b
Author: boluor <[email protected]>
AuthorDate: Wed May 27 21:32:10 2026 -0700

    [fix](doc) dense-rank.md: add missing int_t setup; rewrite malformed result 
block (#3821)
    
    ## Summary
    
    Doc page (4.x): \`sql-functions/window-functions/dense-rank.md\` (EN +
    ZH).
    
    Both EN and ZH reference a table \`int_t\` that the page never creates,
    so copy-pasting the example fails on a fresh cluster. Two more inherited
    issues on the same result block:
    
    1. The header separator was rendered as a markdown table separator \`|
    --- | --- | ---- |\` interleaved into what was otherwise an ASCII grid —
    that is not mysql client output.
    2. Two of the data rows had trailing \`-- comment\` annotations appended
    after the row's closing \`|\` (e.g. \`| ... | -- Same values receive the
    same rank |\`). This is the same shape that broke verification on
    \`first-value.md\` (PR #3788).
    
    This PR:
    - Adds a setup block (CREATE TABLE + INSERT of 9 rows) to both EN and
    ZH.
    - Replaces the malformed result block with the verbatim mysql client
    output from Apache Doris 4.1.1 (clean 6-char-wide columns, no markdown
    separator, no inline comments).
    - Lifts the two teaching annotations out of the table into a single
    prose sentence above the result block.
    
    ## Verification
    
    \`\`\`
    mysql> -- after the setup block above
    mysql> select x, y, dense_rank() over(partition by x order by y) as rank
    from int_t;
    +------+------+------+
    | x    | y    | rank |
    +------+------+------+
    |    1 |    1 |    1 |
    |    1 |    2 |    2 |
    |    1 |    2 |    2 |
    |    2 |    1 |    1 |
    |    2 |    2 |    2 |
    |    2 |    3 |    3 |
    |    3 |    1 |    1 |
    |    3 |    1 |    1 |
    |    3 |    2 |    2 |
    +------+------+------+
    \`\`\`
    
    Run three times — row order is stable across runs on a single-bucket
    partition.
    
    ## Test plan
    
    - [x] CREATE/INSERT + the example SELECT on a 4.1.1 cluster — produces
    the documented output exactly.
    - [x] EN and ZH structure mirror each other (same setup, same SQL, same
    result, parallel prose).
    - [x] No deletion of teaching content; the two inline annotations are
    preserved as a one-sentence intro to the result.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
---
 .../sql-functions/window-functions/dense-rank.md   | 41 +++++++++++++++-------
 .../sql-functions/window-functions/dense-rank.md   | 41 +++++++++++++++-------
 2 files changed, 56 insertions(+), 26 deletions(-)

diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/window-functions/dense-rank.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/window-functions/dense-rank.md
index 040eb58eddc..5f5f23a8799 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/window-functions/dense-rank.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/window-functions/dense-rank.md
@@ -23,22 +23,37 @@ DENSE_RANK()
 
 ## 举例
 
+准备 `int_t` 表,并插入示例所需的行:
+
+```sql
+CREATE TABLE int_t (x INT, y INT)
+DISTRIBUTED BY HASH(x) BUCKETS 1
+PROPERTIES ("replication_num" = "1");
+
+INSERT INTO int_t VALUES
+    (1, 1), (1, 2), (1, 2),
+    (2, 1), (2, 2), (2, 3),
+    (3, 1), (3, 1), (3, 2);
+```
+
 ```sql
 select x, y, dense_rank() over(partition by x order by y) as rank from int_t;
 ```
 
+同一分区内相同的值会获得相同排名,且排名连续(无空缺——这正是 `DENSE_RANK` 与 `RANK` 的区别):
+
 ```text
-+-----+-----+------+
-| x   | y   | rank |
-| --- | --- | ---- |
-| 1   | 1   | 1    |
-| 1   | 2   | 2    |
-| 1   | 2   | 2    | -- 相同值具有相同排名 |
-| 2   | 1   | 1    |
-| 2   | 2   | 2    |
-| 2   | 3   | 3    | -- 排名连续,没有空缺 |
-| 3   | 1   | 1    |
-| 3   | 1   | 1    |
-| 3   | 2   | 2    |
-+-----+-----+------+
++------+------+------+
+| x    | y    | rank |
++------+------+------+
+|    1 |    1 |    1 |
+|    1 |    2 |    2 |
+|    1 |    2 |    2 |
+|    2 |    1 |    1 |
+|    2 |    2 |    2 |
+|    2 |    3 |    3 |
+|    3 |    1 |    1 |
+|    3 |    1 |    1 |
+|    3 |    2 |    2 |
++------+------+------+
 ```
\ No newline at end of file
diff --git 
a/versioned_docs/version-4.x/sql-manual/sql-functions/window-functions/dense-rank.md
 
b/versioned_docs/version-4.x/sql-manual/sql-functions/window-functions/dense-rank.md
index 286f211e09e..bb57842c095 100644
--- 
a/versioned_docs/version-4.x/sql-manual/sql-functions/window-functions/dense-rank.md
+++ 
b/versioned_docs/version-4.x/sql-manual/sql-functions/window-functions/dense-rank.md
@@ -22,22 +22,37 @@ Returns a BIGINT type ranking value, starting from 1.
 
 ## Examples
 
+Setup — create the `int_t` table and load the rows the example uses:
+
+```sql
+CREATE TABLE int_t (x INT, y INT)
+DISTRIBUTED BY HASH(x) BUCKETS 1
+PROPERTIES ("replication_num" = "1");
+
+INSERT INTO int_t VALUES
+    (1, 1), (1, 2), (1, 2),
+    (2, 1), (2, 2), (2, 3),
+    (3, 1), (3, 1), (3, 2);
+```
+
 ```sql
 select x, y, dense_rank() over(partition by x order by y) as rank from int_t;
 ```
 
+Identical values within a partition receive the same rank, and the ranks are 
consecutive (no gaps — that is how `DENSE_RANK` differs from `RANK`):
+
 ```text
-+-----+-----+------+
-| x   | y   | rank |
-| --- | --- | ---- |
-| 1   | 1   | 1    |
-| 1   | 2   | 2    |
-| 1   | 2   | 2    | -- Same values receive the same rank |
-| 2   | 1   | 1    |
-| 2   | 2   | 2    |
-| 2   | 3   | 3    | -- Rankings are consecutive, no gaps |
-| 3   | 1   | 1    |
-| 3   | 1   | 1    |
-| 3   | 2   | 2    |
-+-----+-----+------+
++------+------+------+
+| x    | y    | rank |
++------+------+------+
+|    1 |    1 |    1 |
+|    1 |    2 |    2 |
+|    1 |    2 |    2 |
+|    2 |    1 |    1 |
+|    2 |    2 |    2 |
+|    2 |    3 |    3 |
+|    3 |    1 |    1 |
+|    3 |    1 |    1 |
+|    3 |    2 |    2 |
++------+------+------+
 ```
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to