-
Notifications
You must be signed in to change notification settings - Fork 141
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
Improve error handling for some more edge cases #3080
Conversation
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
legacy/src/main/java/org/opensearch/sql/legacy/query/OpenSearchActionFactory.java
Show resolved
Hide resolved
@@ -122,7 +123,23 @@ public boolean visit(SQLIdentifierExpr expr) { | |||
String fullFieldName = arr[1]; | |||
|
|||
String index = curScope().getAliases().get(alias); | |||
if (index == null) { |
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 don't see issue related. Could you elaborate what's the current behavior without the changes? From what I see here, we try to find the index corresponding to an alias. If not found, does it mean the alias may be wrong?
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 issue is that it doesn't get caught as a specific error so the response is unclear/unactionable -- when you pass invalid indices, this index not being found propagates up as a generic internal server error
OpenSearchException[Internal error occurred while processing request]
For more details, please send request for Json format to see the raw response from OpenSearch engine.
Signed-off-by: Simeon Widdis <[email protected]>
* Add failing tests Signed-off-by: Simeon Widdis <[email protected]> * Fix the first test Signed-off-by: Simeon Widdis <[email protected]> * Revise the tests Signed-off-by: Simeon Widdis <[email protected]> * Fix wildcard tests Signed-off-by: Simeon Widdis <[email protected]> * Add license header Signed-off-by: Simeon Widdis <[email protected]> * Fix rerunning SQL parsing Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]> (cherry picked from commit 5852ce3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add failing tests Signed-off-by: Simeon Widdis <[email protected]> * Fix the first test Signed-off-by: Simeon Widdis <[email protected]> * Revise the tests Signed-off-by: Simeon Widdis <[email protected]> * Fix wildcard tests Signed-off-by: Simeon Widdis <[email protected]> * Add license header Signed-off-by: Simeon Widdis <[email protected]> * Fix rerunning SQL parsing Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]> (cherry picked from commit 5852ce3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
) * Add failing tests Signed-off-by: Simeon Widdis <[email protected]> * Fix the first test Signed-off-by: Simeon Widdis <[email protected]> * Revise the tests Signed-off-by: Simeon Widdis <[email protected]> * Fix wildcard tests Signed-off-by: Simeon Widdis <[email protected]> * Add license header Signed-off-by: Simeon Widdis <[email protected]> * Fix rerunning SQL parsing Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]>
) (#3115) * Improve error handling for some more edge cases (#3080) * Add failing tests Signed-off-by: Simeon Widdis <[email protected]> * Fix the first test Signed-off-by: Simeon Widdis <[email protected]> * Revise the tests Signed-off-by: Simeon Widdis <[email protected]> * Fix wildcard tests Signed-off-by: Simeon Widdis <[email protected]> * Add license header Signed-off-by: Simeon Widdis <[email protected]> * Fix rerunning SQL parsing Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]> * Fix test imports Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]>
* Improve error handling for some more edge cases (#3080) * Add failing tests Signed-off-by: Simeon Widdis <[email protected]> * Fix the first test Signed-off-by: Simeon Widdis <[email protected]> * Revise the tests Signed-off-by: Simeon Widdis <[email protected]> * Fix wildcard tests Signed-off-by: Simeon Widdis <[email protected]> * Add license header Signed-off-by: Simeon Widdis <[email protected]> * Fix rerunning SQL parsing Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]> * Fix: CSV and Raw output, escape quotes (#3063) Fixes #3050 Signed-off-by: Mike Swierczek <[email protected]> (cherry picked from commit cfe38d7) Signed-off-by: Simeon Widdis <[email protected]> * Fix merge conflict Signed-off-by: Simeon Widdis <[email protected]> --------- Signed-off-by: Simeon Widdis <[email protected]> Signed-off-by: Mike Swierczek <[email protected]> Signed-off-by: Simeon Widdis <[email protected]> Co-authored-by: Mike Swierczek <[email protected]>
Description
Improves error handling for some types of malformed SQL queries.
Related Issues
N/A
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.