-
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
Async query get result bug fix #2443
Async query get result bug fix #2443
Conversation
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2443 +/- ##
=========================================
Coverage 95.39% 95.40%
- Complexity 4990 4992 +2
=========================================
Files 478 478
Lines 13910 13917 +7
Branches 932 933 +1
=========================================
+ Hits 13270 13277 +7
Misses 618 618
Partials 22 22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
The failed CI seems not relevant. It keeps failing on retry and failed in |
spark/src/main/java/org/opensearch/sql/spark/dispatcher/AsyncQueryHandler.java
Show resolved
Hide resolved
spark/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryGetResultSpecTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Chen Dai <daichen@amazon.com>
// Consider statement still running if result doc created in submit() is not available yet | ||
JSONObject result = new JSONObject(); | ||
result.put(STATUS_FIELD, StatementState.RUNNING.getState()); | ||
result.put(ERROR_FIELD, ""); |
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.
is the error field mandatory even if there is no error ?
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.
In getAsyncQueryResults()
API code, it always fetch status and error field from what is returned here. Although it uses optString
, I thought it maybe more clear to pass it here.
spark/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceSpec.java
Outdated
Show resolved
Hide resolved
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.
see comments below
Signed-off-by: Chen Dai <daichen@amazon.com>
* Add IT to reproduce the bug first Signed-off-by: Chen Dai <daichen@amazon.com> * Modify IT as temporary reproduce commit Signed-off-by: Chen Dai <daichen@amazon.com> * Fix issue by preferred option and modify IT Signed-off-by: Chen Dai <daichen@amazon.com> * Refactor IT with fluent assertion Signed-off-by: Chen Dai <daichen@amazon.com> * Add IT for batch query handler Signed-off-by: Chen Dai <daichen@amazon.com> * Add IT for streaming query handler Signed-off-by: Chen Dai <daichen@amazon.com> * Add more IT for normal case Signed-off-by: Chen Dai <daichen@amazon.com> * Add IT for drop index Signed-off-by: Chen Dai <daichen@amazon.com> * Consider drop statement running if result doc unavailable Signed-off-by: Chen Dai <daichen@amazon.com> * Fix broken UT Signed-off-by: Chen Dai <daichen@amazon.com> * Address PR comments Signed-off-by: Chen Dai <daichen@amazon.com> * Address PR comments Signed-off-by: Chen Dai <daichen@amazon.com> --------- Signed-off-by: Chen Dai <daichen@amazon.com> (cherry picked from commit 60058ce) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add IT to reproduce the bug first * Modify IT as temporary reproduce commit * Fix issue by preferred option and modify IT * Refactor IT with fluent assertion * Add IT for batch query handler * Add IT for streaming query handler * Add more IT for normal case * Add IT for drop index * Consider drop statement running if result doc unavailable * Fix broken UT * Address PR comments * Address PR comments --------- (cherry picked from commit 60058ce) Signed-off-by: Chen Dai <daichen@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Followed option 2 in #2436 (comment). Consider query statement complete and successful only if statement state is SUCCESS and query result is available (searchable). Please see more details in the issue comment.
Changes:
AsyncQueryHandler
and subclass as neededIndexQuerySpecTest
up to parent class so new IT in this PR can use it.Issues Resolved
#2436, #2439
Check List
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.