-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
SQL: use a proper error message for queries directed at empty mapping indices #52967
Conversation
Pinging @elastic/es-search (:Search/SQL) |
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.
LGTM
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.
Nice one!
// Create an index without any types | ||
Request request = new Request("PUT", "/test"); | ||
request.setJsonEntity("{}"); | ||
client().performRequest(request); | ||
|
||
assertFoundOneProblem(command("SELECT * FROM test")); | ||
//assertEquals("line 1:15: [test] doesn't have any types so it is incompatible with sql" + END, readLine()); | ||
assertEquals("line 1:15: Unknown index [test]" + END, readLine()); | ||
assertEquals("line 1:8: Cannot determine columns for [*]" + END, readLine()); |
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.
I think this is incorrect - if we know the index is empty, we should return no columns since we can determine them and know there are none.
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.
Created #53001
…ng (elastic#52967) (cherry picked from commit a0bd83a)
Until now, when a query was executed against an index that had no mapping a misleading "index not found" error message was issued. This PR fixes this error message by pointing out the columns not being found instead.
Fixes #52865.