Skip to content

Commit 5807c47

Browse files
craigtavernerleemthompoalex-spies
committed
[9.1] Fixes to null-predicates and lookup-join docs (elastic#130440 elastic#130410) (elastic#130537)
* Support types table in lookup join docs (elastic#130410) * Support types table in lookup join docs * Don't show a results column in the join types * Make LOOKUP JOIN types table more compact * Update docs/reference/query-languages/esql/esql-lookup-join.md Co-authored-by: Liam Thompson <[email protected]> Co-authored-by: Alexander Spies <[email protected]> * Fix the ESQL docs for the null predicates (elastic#130440) Fix null predicates docs * This also includes moving the note above the examples in the Kibana inline docs. * Add missing knn docs * Refine newlines in kibana docs --------- Co-authored-by: Liam Thompson <[email protected]> Co-authored-by: Alexander Spies <[email protected]>
1 parent 6baf029 commit 5807c47

File tree

42 files changed

+443
-486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+443
-486
lines changed

docs/reference/query-languages/esql/_snippets/commands/layout/lookup-join.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ results, the output will contain one row for each matching combination.
4545
For important information about using `LOOKUP JOIN`, refer to [Usage notes](../../../../esql/esql-lookup-join.md#usage-notes).
4646
::::
4747

48+
:::{include} ../types/lookup-join.md
49+
:::
50+
4851
**Examples**
4952

5053
**IP Threat correlation**: This query would allow you to see if any source
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.
2+
3+
**Supported types**
4+
5+
| field from the left index | field from the lookup index |
6+
| --- | --- |
7+
| boolean | boolean |
8+
| byte | half_float, float, double, scaled_float, byte, short, integer, long |
9+
| date | date |
10+
| date_nanos | date_nanos |
11+
| double | half_float, float, double, scaled_float, byte, short, integer, long |
12+
| float | half_float, float, double, scaled_float, byte, short, integer, long |
13+
| half_float | half_float, float, double, scaled_float, byte, short, integer, long |
14+
| integer | half_float, float, double, scaled_float, byte, short, integer, long |
15+
| ip | ip |
16+
| keyword | keyword |
17+
| long | half_float, float, double, scaled_float, byte, short, integer, long |
18+
| scaled_float | half_float, float, double, scaled_float, byte, short, integer, long |
19+
| short | half_float, float, double, scaled_float, byte, short, integer, long |
20+
| text | keyword |
21+

docs/reference/query-languages/esql/_snippets/functions/description/knn.md

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/examples/knn.md

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/functionNamedParams/knn.md

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/layout/knn.md

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/parameters/knn.md

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/operators/examples/predicates.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/reference/query-languages/esql/_snippets/operators/types/predicates.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/reference/query-languages/esql/esql-lookup-join.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,38 @@ Refer to the examples section of the [`LOOKUP JOIN`](/reference/query-languages/
142142

143143
## Prerequisites [esql-lookup-join-prereqs]
144144

145-
To use `LOOKUP JOIN`, the following requirements must be met:
145+
### Index configuration
146146

147-
* Indices used for lookups must be configured with the [`lookup` index mode](/reference/elasticsearch/index-settings/index-modules.md#index-mode-setting)
148-
* **Compatible data types**: The join key and join field in the lookup index must have compatible data types. This means:
149-
* The data types must either be identical or be internally represented as the same type in {{esql}}
150-
* Numeric types follow these compatibility rules:
151-
* `short` and `byte` are compatible with `integer` (all represented as `int`)
152-
* `float`, `half_float`, and `scaled_float` are compatible with `double` (all represented as `double`)
153-
* For text fields: You can only use text fields as the join key on the left-hand side of the join and only if they have a `.keyword` subfield
147+
Indices used for lookups must be configured with the [`lookup` index mode](/reference/elasticsearch/index-settings/index-modules.md#index-mode-setting).
154148

149+
### Data type compatibility
150+
151+
Join keys must have compatible data types between the source and lookup indices. Types within the same compatibility group can be joined together:
152+
153+
| Compatibility group | Types | Notes |
154+
|------------------------|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
155+
| **Numeric family** | `byte`, `short`, `integer`, `long`, `half_float`, `float`, `scaled_float`, `double` | All compatible |
156+
| **Keyword family** | `keyword`, `text.keyword` | Text fields only as join key on left-hand side and must have `.keyword` subfield |
157+
| **Date (Exact)** | `date` | Must match exactly |
158+
| **Date Nanos (Exact)** | `date_nanos` | Must match exactly |
159+
| **Boolean** | `boolean` | Must match exactly |
160+
161+
```{tip}
155162
To obtain a join key with a compatible type, use a [conversion function](/reference/query-languages/esql/functions-operators/type-conversion-functions.md) if needed.
163+
```
156164

157-
For a complete list of supported data types and their internal representations, see the [Supported Field Types documentation](/reference/query-languages/esql/limitations.md#_supported_types).
165+
### Unsupported Types
166+
167+
In addition to the [{{esql}} unsupported field types](/reference/query-languages/esql/limitations.md#_unsupported_types), `LOOKUP JOIN` does not support:
168+
169+
* `VERSION`
170+
* `UNSIGNED_LONG`
171+
* Spatial types like `GEO_POINT`, `GEO_SHAPE`
172+
* Temporal intervals like `DURATION`, `PERIOD`
173+
174+
```{note}
175+
For a complete list of all types supported in `LOOKUP JOIN`, refer to the [`LOOKUP JOIN` supported types table](/reference/query-languages/esql/commands/processing-commands.md#esql-lookup-join).
176+
```
158177

159178
## Usage notes
160179

0 commit comments

Comments
 (0)