Skip to content

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

@boluor

Description

@boluor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions