Skip to content

doc bug: EXPLODE_SPLIT example output is not sorted despite ORDER BY (version-3.x/2.1) #3889

@boluor

Description

@boluor

On the EXPLODE_SPLIT page (table-functions/explode-split.md, version-3.x and version-2.1), one example shows an output that contradicts its own ORDER BY:

select k1, e1 from example1 lateral view explode_split(k2, ,) tmp1 as e1 where k1 = 5 order by k1, e1;
+------+------+
| k1   | e1   |
+------+------+
|    5 | 2    |
|    5 | 3    |
|    5 | 1    |
+------+------+

k2 for k1 = 5 is 1,2,3, so explode_split yields 1, 2, 3. With ORDER BY k1, e1 the rows must come back sorted by e1 — i.e. 1, 2, 3 — which is exactly what the current engine returns (3.1.4 and 2.1.11). The documented order 2, 3, 1 is not sorted and cannot be produced by the shown query.

Suggested fix — update the expected output to the sorted order:

|    5 | 1    |
|    5 | 2    |
|    5 | 3    |

Filing separately from the missing example1 setup for this page (handled in a Line-B setup PR); all other examples on the page reproduce correctly.

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