You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/query-languages/esql/esql-lookup-join.md
+26-12Lines changed: 26 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -142,24 +142,38 @@ Refer to the examples section of the [`LOOKUP JOIN`](/reference/query-languages/
142
142
143
143
## Prerequisites [esql-lookup-join-prereqs]
144
144
145
-
To use `LOOKUP JOIN`, the following requirements must be met:
145
+
### Index configuration
146
146
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
154
-
*`DATE` and `DATE_NANOS` can only be joined against the exact same type.
147
+
Indices used for lookups must be configured with the [`lookup` index mode](/reference/elasticsearch/index-settings/index-modules.md#index-mode-setting).
155
148
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:
|**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}
156
162
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
+
```
157
164
158
-
The list of unsupported fields includes all types not supported by {{esql}} as described in the [Unsupported Field Types documentation](/reference/query-languages/esql/limitations.md#_unsupported_types).
159
-
as well as the following: `VERSION`, `UNSIGNED_LONG`, all spatial types like `GEO_POINT`, `GEO_SHAPE`, and all
160
-
temporal periods like `DURATION` and `PERIOD`.
165
+
### Unsupported Types
161
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}
162
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).
Copy file name to clipboardExpand all lines: x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/LookupJoinTypesIT.java
0 commit comments