Skip to content

Commit

Permalink
[9.0] ESQL: Add reference entry for LOOKUP JOIN (#210201) (#210268)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `9.0`:
- [ESQL: Add reference entry for LOOKUP JOIN
(#210201)](#210201)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alexander
Spies","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-07T20:39:10Z","message":"ESQL:
Add reference entry for LOOKUP JOIN (#210201)\n\nI couldn't verify if
this builds correctly, as I couldn't quickly whip\r\nup a dev
environment locally that could build this. Is there a preview\r\nbuilt
by the CI?\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"3915d3310cb9b05f598241858aa1bed2cde4c8d6","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Feature:ES|QL","Team:ESQL","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"ESQL:
Add reference entry for LOOKUP
JOIN","number":210201,"url":"https://github.com/elastic/kibana/pull/210201","mergeCommit":{"message":"ESQL:
Add reference entry for LOOKUP JOIN (#210201)\n\nI couldn't verify if
this builds correctly, as I couldn't quickly whip\r\nup a dev
environment locally that could build this. Is there a preview\r\nbuilt
by the CI?\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"3915d3310cb9b05f598241858aa1bed2cde4c8d6"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210201","number":210201,"mergeCommit":{"message":"ESQL:
Add reference entry for LOOKUP JOIN (#210201)\n\nI couldn't verify if
this builds correctly, as I couldn't quickly whip\r\nup a dev
environment locally that could build this. Is there a preview\r\nbuilt
by the CI?\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"3915d3310cb9b05f598241858aa1bed2cde4c8d6"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alexander Spies <[email protected]>
  • Loading branch information
kibanamachine and alex-spies authored Feb 7, 2025
1 parent 0bb856e commit f32f9d1
Showing 1 changed file with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,61 @@ FROM employees
/>
),
},
{
label: i18n.translate('languageDocumentation.documentationESQL.lookupJoin', {
defaultMessage: 'LOOKUP JOIN',
}),
preview: true,
description: (
<Markdown
openLinksInNewTab={true}
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.lookupJoin.markdown',
{
defaultMessage: `### LOOKUP JOIN
You can use \`LOOKUP JOIN\` to add data from an existing index to incoming rows. While this is similar to \`ENRICH\`, it does not require an enrich policy to be executed beforehand. Additionally, if multiple matching documents are found in the lookup index, they will generate multiple output rows.
\`\`\`
ROW language_code = 1
| LOOKUP JOIN languages ON language_code
\`\`\`
An index that is used in \`LOOKUP JOIN\` needs to be in lookup mode. To create a lookup index, set the index mode to lookup.
\`\`\`
PUT languages
'{
"settings": {
"index":{
"mode":"lookup"
}
}
}'
\`\`\`
The join key field must have a compatible type and match the name of the field in the lookup index to find matching documents. You can use \`RENAME\` or \`EVAL\` to rename columns as needed.
\`\`\`
FROM employees
| EVAL language_code = languages
| LOOKUP JOIN languages ON language_code
\`\`\`
In case of name collisions, the fields from the lookup index will override the existing fields.
`,
ignoreTag: true,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
}
)}
/>
),
},
{
label: i18n.translate('languageDocumentation.documentationESQL.mvExpand', {
defaultMessage: 'MV_EXPAND',
}),
preview: true,
description: (
<Markdown
markdownContent={i18n.translate(
Expand Down

0 comments on commit f32f9d1

Please sign in to comment.