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

yiguolei 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 d9a06e03a23 docs: fix ARRAY_MAP examples across versions and languages 
(#4424)
d9a06e03a23 is described below

commit d9a06e03a23beb75f35d94538f87aa54cd81273c
Author: Ezequiel Salazar <[email protected]>
AuthorDate: Mon Nov 30 21:22:21 2026 -0600

    docs: fix ARRAY_MAP examples across versions and languages (#4424)
    
    ## Summary
    
    Align the `ARRAY_MAP` integer-to-string example with its SQL and sample
    data, and cover the same operation in the English and Chinese
    documentation for all active versions.
    
    ## Changes
    
    - In 2.1 and 3.x, select both `c_array1` and the mapped array, use the
    existing `array_test2` table, and add `ORDER BY id`.
    - Correct the third output row from `[] | []` to `[1] | ['1']` to match
    the inserted data.
    - Apply the fix to both English and Chinese pages for 2.1 and 3.x.
    - Add a standalone integer-to-string example to the dev and 4.x English
    and Chinese pages. These pages use literal-array examples and no longer
    contain the old table-based example.
    
    ## Versions
    
    - [x] dev
    - [x] 4.x
    - [x] 3.x
    - [x] 2.1 or older (not covered by version/language sync gate)
    
    ## Languages
    
    - [x] Chinese
    - [x] English
    
    ## Docs Checklist
    
    - [x] Checked by AI
    - [ ] Test Cases Built
    - [x] Updated required version and language counterparts, or explained
    why not
    - [x] If only one language changed, confirmed whether source/translation
    counterparts need sync
    
    ## Validation
    
    - Checked the corrected 2.1/3.x queries against each page's table
    definition and insert statements; all four output rows match the sample
    data and the two selected columns.
    - Verified that the dev/4.x examples show the same input and
    string-mapping output in both languages and require no table setup.
    - Compiled all eight affected Markdown pages with the site's MDX
    compiler in Markdown mode, and checked front matter and code fences.
    - Ran the changed-file i18n synchronization check with no findings.
    - Ran `git diff --check` successfully.
    - SQL examples have not been executed against a live Apache Doris
    instance. A full website build was not run.
    
    ## Version and Language Scope
    
    This PR updates eight pages: English and Chinese for dev, 4.x, 3.x, and
    2.1. The 3.x English page still contained the affected example and is
    included in the fix.
    
    Archived 2.0 and 1.2 pages also contain the old example, but are outside
    this PR's active-version scope.
    
    ## Related Issue
    
    Fixes #3887
    
    ---------
    
    Co-authored-by: morningman <[email protected]>
---
 .../scalar-functions/array-functions/array-map.md          | 14 ++++++++++++++
 .../scalar-functions/array-functions/array-map.md          | 14 ++++++++++++++
 .../scalar-functions/array-functions/array-map.md          |  8 ++++----
 .../scalar-functions/array-functions/array-map.md          | 14 ++++++++++++++
 .../scalar-functions/array-functions/array-map.md          |  8 ++++----
 .../scalar-functions/array-functions/array-map.md          | 14 ++++++++++++++
 6 files changed, 64 insertions(+), 8 deletions(-)

diff --git 
a/docs/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md 
b/docs/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
index 1721daac966..f3805816b1a 100644
--- 
a/docs/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
+++ 
b/docs/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
@@ -73,6 +73,20 @@ SELECT array_map(x -> round(x), [1.1, 2.7, 3.3, 4.9, 5.5]);
 +--------------------------------------------------+
 ```
 
+Convert each integer in an array to a string, showing both the input and the 
mapped result:
+```sql
+SELECT
+    [1, 2, 3, 4, 5] AS c_array1,
+    array_map(x -> CAST(x AS STRING), [1, 2, 3, 4, 5]) AS mapped_array;
+```
+```text
++-----------------+---------------------------+
+| c_array1        | mapped_array              |
++-----------------+---------------------------+
+| [1, 2, 3, 4, 5] | ["1", "2", "3", "4", "5"] |
++-----------------+---------------------------+
+```
+
 Calculate the length of each element in a string array:
 ```sql
 SELECT array_map(x -> length(x), ['a', 'bb', 'ccc', 'dddd', 'eeeee']);
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
index 5331b02afe5..3d5704728a2 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
@@ -73,6 +73,20 @@ SELECT array_map(x -> round(x), [1.1, 2.7, 3.3, 4.9, 5.5]);
 +--------------------------------------------------+
 ```
 
+将数组中的每个整数转换为字符串,同时展示输入数组和转换结果:
+```sql
+SELECT
+    [1, 2, 3, 4, 5] AS c_array1,
+    array_map(x -> CAST(x AS STRING), [1, 2, 3, 4, 5]) AS mapped_array;
+```
+```text
++-----------------+---------------------------+
+| c_array1        | mapped_array              |
++-----------------+---------------------------+
+| [1, 2, 3, 4, 5] | ["1", "2", "3", "4", "5"] |
++-----------------+---------------------------+
+```
+
 对字符串数组中的每个元素进行长度计算:
 ```sql
 SELECT array_map(x -> length(x), ['a', 'bb', 'ccc', 'dddd', 'eeeee']);
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
index 1f00800f8e3..6f8e62f1aec 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
@@ -167,15 +167,15 @@ select *,array_map((x,y)->x>y,c_array1,c_array2) from 
array_test2 order by id;
 
+------+-----------------+-------------------------+----------------------------------------------------------+
 ```
 ```sql
-select array_map(x->cast(x as string), c_array1) from test_array_map_function;
+select c_array1, array_map(x->cast(x as string), c_array1) from array_test2 
order by id;
 ```
 ```text
 +-----------------+-------------------------------------------------------+
 | c_array1        | array_map([x] -> CAST(x(0) AS CHARACTER), `c_array1`) |
 +-----------------+-------------------------------------------------------+
-| [1, 2, 3, 4, 5] | ['1', '2', '3', '4', '5']                             |
-| [6, 7, 8]       | ['6', '7', '8']                                       |
-| []              | []                                                    |
+| [1, 2, 3, 4, 5] | ["1", "2", "3", "4", "5"]                             |
+| [6, 7, 8]       | ["6", "7", "8"]                                       |
+| [1]             | ["1"]                                                 |
 | NULL            | NULL                                                  |
 +-----------------+-------------------------------------------------------+
 ```
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
index c35479dd224..b4e9cf549cd 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
@@ -72,6 +72,20 @@ SELECT array_map(x -> round(x), [1.1, 2.7, 3.3, 4.9, 5.5]);
 +--------------------------------------------------+
 ```
 
+将数组中的每个整数转换为字符串,同时展示输入数组和转换结果:
+```sql
+SELECT
+    [1, 2, 3, 4, 5] AS c_array1,
+    array_map(x -> CAST(x AS STRING), [1, 2, 3, 4, 5]) AS mapped_array;
+```
+```text
++-----------------+---------------------------+
+| c_array1        | mapped_array              |
++-----------------+---------------------------+
+| [1, 2, 3, 4, 5] | ["1", "2", "3", "4", "5"] |
++-----------------+---------------------------+
+```
+
 对字符串数组中的每个元素进行长度计算:
 ```sql
 SELECT array_map(x -> length(x), ['a', 'bb', 'ccc', 'dddd', 'eeeee']);
diff --git 
a/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
 
b/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
index 5da57d9cbca..f76c69ed62f 100644
--- 
a/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
+++ 
b/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
@@ -167,15 +167,15 @@ select *,array_map((x,y)->x>y,c_array1,c_array2) from 
array_test2 order by id;
 
+------+-----------------+-------------------------+----------------------------------------------------------+
 ```
 ```sql
-select array_map(x->cast(x as string), c_array1) from test_array_map_function;
+select c_array1, array_map(x->cast(x as string), c_array1) from array_test2 
order by id;
 ```
 ```text
 +-----------------+-------------------------------------------------------+
 | c_array1        | array_map([x] -> CAST(x(0) AS CHARACTER), `c_array1`) |
 +-----------------+-------------------------------------------------------+
-| [1, 2, 3, 4, 5] | ['1', '2', '3', '4', '5']                             |
-| [6, 7, 8]       | ['6', '7', '8']                                       |
-| []              | []                                                    |
+| [1, 2, 3, 4, 5] | ["1", "2", "3", "4", "5"]                             |
+| [6, 7, 8]       | ["6", "7", "8"]                                       |
+| [1]             | ["1"]                                                 |
 | NULL            | NULL                                                  |
 +-----------------+-------------------------------------------------------+
 ```
diff --git 
a/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
 
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
index 04befe89de5..f48d0766a04 100644
--- 
a/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
+++ 
b/versioned_docs/version-4.x/sql-manual/sql-functions/scalar-functions/array-functions/array-map.md
@@ -72,6 +72,20 @@ SELECT array_map(x -> round(x), [1.1, 2.7, 3.3, 4.9, 5.5]);
 +--------------------------------------------------+
 ```
 
+Convert each integer in an array to a string, showing both the input and the 
mapped result:
+```sql
+SELECT
+    [1, 2, 3, 4, 5] AS c_array1,
+    array_map(x -> CAST(x AS STRING), [1, 2, 3, 4, 5]) AS mapped_array;
+```
+```text
++-----------------+---------------------------+
+| c_array1        | mapped_array              |
++-----------------+---------------------------+
+| [1, 2, 3, 4, 5] | ["1", "2", "3", "4", "5"] |
++-----------------+---------------------------+
+```
+
 Calculate the length of each element in a string array:
 ```sql
 SELECT array_map(x -> length(x), ['a', 'bb', 'ccc', 'dddd', 'eeeee']);


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

Reply via email to