Skip to content

Commit 4065510

Browse files
authored
[DOCS][8.x] ESQL: Document LU JOIN/MV_EXPAND not respecting SORT (elastic#127813)
* [DOCS][8.x] ESQL: Document LU JOIN/MV_EXPAND not respecting SORT * Fix nasty asciidoc backticks
1 parent 8900e0d commit 4065510

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

docs/reference/esql/esql-lookup-join.asciidoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,29 @@ To obtain a join key with a compatible type, use a
231231
For a complete list of supported data types and their internal
232232
representations, see the <<esql-supported-types,Supported Field Types documentation>>.
233233

234+
[discrete]
235+
[[esql-lookup-join-usage-notes]]
236+
==== Usage notes
237+
238+
This section covers important details about `LOOKUP JOIN` that impact query behavior and results. Review these details to ensure your queries work as expected and to troubleshoot unexpected results.
239+
240+
[discrete]
241+
[[esql-lookup-join-usage-notes-name-collisions]]
242+
===== Handling name collisions
243+
244+
When fields from the lookup index match existing column names, the new columns override the existing ones.
245+
Before the `LOOKUP JOIN` command, preserve columns by either:
246+
247+
* Using `RENAME` to assign non-conflicting names
248+
* Using `EVAL` to create new columns with different names
249+
250+
[discrete]
251+
[[esql-lookup-join-usage-notes-sorting]]
252+
===== Sorting behavior
253+
254+
The output rows produced by `LOOKUP JOIN` can be in any order and may not
255+
respect preceding `SORT` commands. To guarantee a certain ordering, place a `SORT` after any `LOOKUP JOIN` commands.
256+
234257
[discrete]
235258
[[esql-lookup-join-limitations]]
236259
==== Limitations

docs/reference/esql/processing-commands/lookup.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ results, the output will contain one row for each matching combination.
5050

5151
[TIP]
5252
====
53-
In case of name collisions, the newly created columns will override existing columns.
53+
For important information about using `LOOKUP JOIN`, refer to <<esql-lookup-join-usage-notes,Usage notes>>.
5454
====
5555

5656
*Examples*

docs/reference/esql/processing-commands/mv_expand.asciidoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ MV_EXPAND column
1919
`column`::
2020
The multivalued column to expand.
2121

22+
[WARNING]
23+
======
24+
The output rows produced by `MV_EXPAND` can be in any order and may not respect
25+
preceding `SORT` commands. To guarantee a certain ordering, place a `SORT` after any
26+
`MV_EXPAND` commands.
27+
======
28+
2229
*Example*
2330

2431
[source.merge.styled,esql]

0 commit comments

Comments
 (0)