-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
base: main
Are you sure you want to change the base?
Fix ESQL index resolution #135826
Conversation
|
||
public void testInexistentIndexNameWithWildcard() throws IOException { | ||
assertErrorMessages(inexistentIndexNameWithWildcard, getInexistentIndexErrorMessage(), 400); | ||
} |
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
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 comment
The reason will be displayed to describe this comment to others. Learn more.
The same, foo* can now expand to empty result set
String q = "FROM cluster-a:nomatch*"; | ||
String expectedError = "Unknown index [cluster-a:nomatch*]"; | ||
expectVerificationExceptionForQuery(q, expectedError, requestIncludeMeta); | ||
expectVerificationExceptionForQuery(q, expectedError, requestIncludeMeta);// TODO this must contain the remote cluster alias |
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.
Here we are getting RemoteTransportException
with cause IndexNotFoundException
with index nonmatch
. It is correct, but it does not give me enough information to point out to cluster-a
in case there are multiple remotes involved. This is likely needs to be added on FieldCaps side
# Conflicts: # x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RequestIndexFilteringTestCase.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/EsqlSession.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/IndexResolver.java
This change updates various aspects of ES|QL index resolution including:
Fixes: #114495
Fixes: #127347