-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Fix ESQL index resolution #135826
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
Draft
idegtiarenko
wants to merge
10
commits into
elastic:main
Choose a base branch
from
idegtiarenko:index_resolution
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+222
−236
Draft
Fix ESQL index resolution #135826
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5bf94ba
Fix ESQL index resolution
idegtiarenko 4f4f327
fix some tests
idegtiarenko d3cd665
fix some tests
idegtiarenko 675b7c2
fix some tests
idegtiarenko b0a563c
Merge branch 'main' into index_resolution
idegtiarenko 555c294
upd
idegtiarenko 82459d9
[CI] Auto commit changes from spotless
d30da96
upd
idegtiarenko cc5fec5
fix skip
idegtiarenko f4d565f
fix test
idegtiarenko 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,15 +85,11 @@ public void testTimestampFilterFromQuery() throws IOException { | |
allOf(instanceOf(List.class), hasSize(docsTest1)) | ||
); | ||
|
||
// filter excludes both indices (no rows); the first analysis step fails because there are no columns, a second attempt succeeds | ||
// after eliminating the index filter. All columns are returned. | ||
// filter excludes both indices (no rows); Empty result set is derived. | ||
builder = timestampFilter("gte", "2025-01-01").query(from("test*")); | ||
assertQueryResult( | ||
runEsql(builder), | ||
matchesList().item(matchesMap().entry("name", "@timestamp").entry("type", "date")) | ||
.item(matchesMap().entry("name", "id1").entry("type", "integer")) | ||
.item(matchesMap().entry("name", "id2").entry("type", "integer")) | ||
.item(matchesMap().entry("name", "value").entry("type", "long")), | ||
matchesList().item(matchesMap().entry("name", "<no-fields>").entry("type", "null")), | ||
allOf(instanceOf(List.class), hasSize(0)) | ||
); | ||
} | ||
|
@@ -206,15 +202,10 @@ public void testIndicesDontExist() throws IOException { | |
assertThat(e.getMessage(), containsString("verification_exception")); | ||
assertThat(e.getMessage(), anyOf(containsString("Unknown index [foo]"), containsString("Unknown index [remote_cluster:foo]"))); | ||
|
||
e = expectThrows(ResponseException.class, () -> runEsql(timestampFilter("gte", "2020-01-01").query(from("foo*")))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same, foo* can now expand to empty result set |
||
e = expectThrows(ResponseException.class, () -> runEsql(timestampFilter("gte", "2020-01-01").query("FROM foo,test1"))); | ||
assertEquals(400, e.getResponse().getStatusLine().getStatusCode()); | ||
assertThat(e.getMessage(), containsString("verification_exception")); | ||
assertThat(e.getMessage(), anyOf(containsString("Unknown index [foo*]"), containsString("Unknown index [remote_cluster:foo*]"))); | ||
|
||
e = expectThrows(ResponseException.class, () -> runEsql(timestampFilter("gte", "2020-01-01").query("FROM foo, test1"))); | ||
assertEquals(404, e.getResponse().getStatusLine().getStatusCode()); | ||
assertThat(e.getMessage(), containsString("index_not_found_exception")); | ||
assertThat(e.getMessage(), containsString("no such index [foo]")); | ||
assertThat(e.getMessage(), containsString("Unknown index [foo,test1]"));// TODO why test1 is reported? | ||
|
||
// Don't test remote patterns here, we'll test them in the multi-cluster tests | ||
if (EsqlCapabilities.Cap.JOIN_LOOKUP_V12.isEnabled()) { | ||
|
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
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.
Now wildcards are allowed to expand to empty result set