doc bug: ARRAY_MAP example SQL selects one column but the output shows two (version-3.x/2.1)

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

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
sql
Domain
documentation

Research direction

Open scalar-functions/array-functions/array-map.md in the version-3.x and version-2.1 documentation. Compare the ARRAY_MAP query with its displayed output, then update the query to select c_array1 alongside the mapped result as suggested. Done means both page versions show SQL whose selected columns match the output table.

Written by the indexing model from the issue text.

Description

On the ARRAY_MAP page (scalar-functions/array-functions/array-map.md, version-3.x and version-2.1), one example does not match its own output:

select array_map(x->cast(x as string), c_array1) from test_array_map_function;
+-----------------+-------------------------------------------------------+
| c_array1        | array_map([x] -> CAST(x(0) AS CHARACTER), `c_array1`) |
+-----------------+-------------------------------------------------------+
| [1, 2, 3, 4, 5] | [1, 2, 3, 4, 5]                             |
...

The SQL selects a single column (the array_map(...) result), but the output table has two columns (c_array1 | array_map(...)). Running the query as written returns only the array_map(...) column.

Suggested fix — align the SQL with the shown output:

select c_array1, array_map(x->cast(x as string), c_array1) from test_array_map_function;

(Also note test_array_map_function is never defined on the page; the missing-setup fix for the other array pages is being handled in the Line-B setup PRs, but this page is left out pending the SQL correction above.)

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

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 Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.