-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Issue #19319: Fix case-insensitive wildcard + aggregation query crash #19489
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?
Conversation
…gned-off-by: Isha Gupta <[email protected]> Signed-off-by: Isha Gupta <[email protected]>
❌ Gradle check result for 3efbfa1: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
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.
Awesome, thanks @ishag4!
@ishag4 -- can you please add a CHANGELOG entry under the "Fixed" section? |
❌ Gradle check result for 1919913: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for df497d1: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for df497d1: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 5be518f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19489 +/- ##
============================================
- Coverage 73.06% 73.02% -0.05%
+ Complexity 70630 70568 -62
============================================
Files 5723 5723
Lines 323513 323522 +9
Branches 46852 46853 +1
============================================
- Hits 236384 236259 -125
- Misses 68013 68181 +168
+ Partials 19116 19082 -34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
422f729
to
5ecb63c
Compare
❌ Gradle check result for 5ecb63c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 43af818: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Automaton automaton = toCaseInsensitiveWildcardAutomaton(wildcardquery); | ||
try { | ||
automaton = Operations.determinize(automaton, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT); | ||
} catch (TooComplexToDeterminizeException e) { |
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.
Quick question: Any other exceptions do we need to handle?
Also, let's add a test case for exception case?
❌ Gradle check result for f12a304: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: ishag4 <[email protected]>
Description
To fix bug where executing a case-insensitive wildcard query combined with aggregations causes an ArrayIndexOutOfBoundsException. The root cause is related to how Lucene’s automaton handles case-insensitive wildcards without determinizing the automaton, leading to instability during query execution.
This PR fixes the issue by explicitly determinizing the automaton generated for case-insensitive wildcard queries before passing it to Lucene’s query execution layer. By converting the automaton to a deterministic finite automaton (DFA), we prevent the exception and ensure stable query execution.
Related Issues
Resolves #19319
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.