Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot#15126
Merged
Merged
Conversation
…field name containing only dot Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Contributor
|
❌ Gradle check result for 94c912e: 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? |
Contributor
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15126 +/- ##
============================================
- Coverage 71.84% 71.73% -0.11%
+ Complexity 62820 62701 -119
============================================
Files 5169 5169
Lines 294664 294666 +2
Branches 42615 42616 +1
============================================
- Hits 211691 211386 -305
- Misses 65530 65820 +290
- Partials 17443 17460 +17 ☔ View full report in Codecov by Sentry. |
jed326
reviewed
Aug 8, 2024
Signed-off-by: Gao Binlong <gbinlong@amazon.com>
Contributor
jed326
approved these changes
Aug 8, 2024
Contributor
Author
|
@reta, mind taking a second look at this PR? Thank you! |
reta
approved these changes
Aug 9, 2024
Contributor
|
Thanks a lot, @gaobinlong ! |
opensearch-trigger-bot Bot
pushed a commit
that referenced
this pull request
Aug 9, 2024
…field name containing only dot (#15126) * Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Modify change log Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Optimize error message Signed-off-by: Gao Binlong <gbinlong@amazon.com> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com> (cherry picked from commit 252742b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta
added a commit
that referenced
this pull request
Aug 9, 2024
…documents with field name containing only dot (#15188) * Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot (#15126) * Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Modify change log Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Optimize error message Signed-off-by: Gao Binlong <gbinlong@amazon.com> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com> (cherry picked from commit 252742b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update 120_field_name.yml Signed-off-by: Andriy Redko <andriy.redko@aiven.io> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Andriy Redko <andriy.redko@aiven.io>
harshavamsi
pushed a commit
to harshavamsi/OpenSearch
that referenced
this pull request
Aug 20, 2024
…field name containing only dot (opensearch-project#15126) * Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Modify change log Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Optimize error message Signed-off-by: Gao Binlong <gbinlong@amazon.com> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com>
wdongyu
pushed a commit
to wdongyu/OpenSearch
that referenced
this pull request
Aug 22, 2024
…field name containing only dot (opensearch-project#15126) * Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Modify change log Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Optimize error message Signed-off-by: Gao Binlong <gbinlong@amazon.com> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com>
akolarkunnu
pushed a commit
to akolarkunnu/OpenSearch
that referenced
this pull request
Sep 10, 2024
…field name containing only dot (opensearch-project#15126) * Fix array_index_out_of_bounds_exception when indexing documents with field name containing only dot Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Modify change log Signed-off-by: Gao Binlong <gbinlong@amazon.com> * Optimize error message Signed-off-by: Gao Binlong <gbinlong@amazon.com> --------- Signed-off-by: Gao Binlong <gbinlong@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
"." as field name yields
array_index_out_of_bounds_exception, the reason is that we split the field name by.here:OpenSearch/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java
Line 208 in 49b7cd4
, if the field name contains only dot, the split result is an empty array, then yields that exception in this line:
OpenSearch/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java
Line 1045 in 0cde7ba
Since
.is reserved for object resolution, we can fail the indexing request when the field name contains only dot.Related Issues
Resolves #14911
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.