-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Initial support for TEXT fields in LOOKUP JOIN condition #119473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a4f3b5e
Initial support for TEXT fields in LOOKUP JOIN condition
craigtaverner c1744c9
Better approach, using KEYWORD subfield
craigtaverner 8eb6554
Merge branch 'main' into lookup_join_text
craigtaverner 69572e5
Add new capability to block mixed-cluster tests
craigtaverner 417d3df
Merge branch 'main' into lookup_join_text
craigtaverner e799ef9
Merge branch 'main' into lookup_join_text
craigtaverner 772659d
Merge branch 'main' into lookup_join_text
craigtaverner 93779f9
Simplify lookup-join validation and remove keyword subfield validation
craigtaverner cbcd532
Merge remote-tracking branch 'origin/main' into lookup_join_text
craigtaverner 0146742
Added yaml tests for failing TEXT lookup and added validation for that
craigtaverner e327808
Fixed failing tests
craigtaverner 77fc5bf
Missing capability check
craigtaverner 2b2f0dc
Merge branch 'main' into lookup_join_text
craigtaverner 4380656
Merge branch 'main' into lookup_join_text
craigtaverner 6a56279
Merge branch 'main' into lookup_join_text
craigtaverner 3491006
Simplify long comment
craigtaverner d5d7cee
Use clearer error message when joining with right-side TEXT
craigtaverner 879ecd4
Merge branch 'main' into lookup_join_text
craigtaverner 724153c
Fix failing test
craigtaverner 863cfc9
Merge remote-tracking branch 'origin/main' into lookup_join_text
craigtaverner 26a76f9
Merge remote-tracking branch 'origin/main' into lookup_join_text
craigtaverner f0ce28a
Merge branch 'main' into lookup_join_text
craigtaverner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/191_lookup_join_text.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| --- | ||
| setup: | ||
| - requires: | ||
| test_runner_features: [capabilities, contains] | ||
| capabilities: | ||
| - method: POST | ||
| path: /_query | ||
| parameters: [] | ||
| capabilities: [lookup_join_text] | ||
| reason: "uses LOOKUP JOIN" | ||
| - do: | ||
| indices.create: | ||
| index: test | ||
| body: | ||
| mappings: | ||
| properties: | ||
| color: | ||
| type: text | ||
| fields: | ||
| keyword: | ||
| type: keyword | ||
| description: | ||
| type: text | ||
| fields: | ||
| keyword: | ||
| type: keyword | ||
| - do: | ||
| indices.create: | ||
| index: test-lookup | ||
| body: | ||
| settings: | ||
| index: | ||
| mode: lookup | ||
| number_of_shards: 1 | ||
| mappings: | ||
| properties: | ||
| color: | ||
| type: text | ||
| fields: | ||
| keyword: | ||
| type: keyword | ||
| description: | ||
| type: text | ||
| fields: | ||
| keyword: | ||
| type: keyword | ||
| - do: | ||
| bulk: | ||
| index: "test" | ||
| refresh: true | ||
| body: | ||
| - { "index": { } } | ||
| - { "color": "red", "description": "The color Red" } | ||
| - { "index": { } } | ||
| - { "color": "blue", "description": "The color Blue" } | ||
| - { "index": { } } | ||
| - { "color": "green", "description": "The color Green" } | ||
| - do: | ||
| bulk: | ||
| index: "test-lookup" | ||
| refresh: true | ||
| body: | ||
| - { "index": { } } | ||
| - { "color": "red", "description": "As red as a tomato" } | ||
| - { "index": { } } | ||
| - { "color": "blue", "description": "As blue as the sky" } | ||
|
|
||
| --- | ||
| keyword-keyword: | ||
| - do: | ||
| esql.query: | ||
| body: | ||
| query: 'FROM test | SORT color | LOOKUP JOIN `test-lookup` ON color.keyword | LIMIT 3' | ||
|
|
||
| - length: { columns: 4 } | ||
| - length: { values: 3 } | ||
| - match: {columns.0.name: "color.keyword"} | ||
| - match: {columns.0.type: "keyword"} | ||
| - match: {columns.1.name: "color"} | ||
| - match: {columns.1.type: "text"} | ||
| - match: {columns.2.name: "description"} | ||
| - match: {columns.2.type: "text"} | ||
| - match: {columns.3.name: "description.keyword"} | ||
| - match: {columns.3.type: "keyword"} | ||
| - match: {values.0: ["blue", "blue", "As blue as the sky", "As blue as the sky"]} | ||
| - match: {values.1: ["green", null, null, null]} | ||
| - match: {values.2: ["red", "red", "As red as a tomato", "As red as a tomato"]} | ||
|
|
||
| --- | ||
| text-keyword: | ||
| - do: | ||
| esql.query: | ||
| body: | ||
| query: 'FROM test | SORT color | RENAME color AS x | EVAL color.keyword = x | LOOKUP JOIN `test-lookup` ON color.keyword | LIMIT 3' | ||
|
|
||
| - length: { columns: 5 } | ||
| - length: { values: 3 } | ||
| - match: {columns.0.name: "x"} | ||
| - match: {columns.0.type: "text"} | ||
| - match: {columns.1.name: "color.keyword"} | ||
| - match: {columns.1.type: "text"} | ||
| - match: {columns.2.name: "color"} | ||
| - match: {columns.2.type: "text"} | ||
| - match: {columns.3.name: "description"} | ||
| - match: {columns.3.type: "text"} | ||
| - match: {columns.4.name: "description.keyword"} | ||
| - match: {columns.4.type: "keyword"} | ||
| - match: {values.0: ["blue", "blue", "blue", "As blue as the sky", "As blue as the sky"]} | ||
| - match: {values.1: ["green", "green", null, null, null]} | ||
| - match: {values.2: ["red", "red", "red", "As red as a tomato", "As red as a tomato"]} | ||
|
|
||
| --- | ||
| text-text: | ||
| - do: | ||
| esql.query: | ||
| body: | ||
| query: 'FROM test | SORT color | LOOKUP JOIN `test-lookup` ON color | LIMIT 3' | ||
| catch: "bad_request" | ||
|
|
||
| - match: { error.type: "verification_exception" } | ||
| - contains: { error.reason: "Found 1 problem\nline 1:55: JOIN with right field [color] of type [TEXT] is not supported" } | ||
|
|
||
| --- | ||
| keyword-text: | ||
| - do: | ||
| esql.query: | ||
| body: | ||
| query: 'FROM test | SORT color | EVAL color = color.keyword | LOOKUP JOIN `test-lookup` ON color | LIMIT 3' | ||
| catch: "bad_request" | ||
|
|
||
| - match: { error.type: "verification_exception" } | ||
| - contains: { error.reason: "Found 1 problem\nline 1:84: JOIN with right field [color] of type [TEXT] is not supported" } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, I missed it, but this should also declare
join_lookup_v11.This should help skipping this spec if something changes about basic lookup logic (such as grammar :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened a pr for it #120771