Fix ClassCastException when using dynamic template with flat_object mapping and dots in field names#13081
Fix ClassCastException when using dynamic template with flat_object mapping and dots in field names#13081cwperks wants to merge 2 commits intoopensearch-project:mainfrom
Conversation
…apping and dots in field names Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Compatibility status:Checks if related components are compatible with change fce90d2 Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/performance-analyzer.git] |
|
❌ Gradle check result for b886c7e: 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 fce90d2: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13081 +/- ##
============================================
+ Coverage 71.42% 71.48% +0.06%
- Complexity 59978 60462 +484
============================================
Files 4985 5026 +41
Lines 282275 284456 +2181
Branches 40946 41197 +251
============================================
+ Hits 201603 203350 +1747
- Misses 63999 64311 +312
- Partials 16673 16795 +122 ☔ View full report in Codecov by Sentry. |
Description
Opening a draft PR to solicit feedback. This fixes an issue that can cause the DocumentParser to throw a ClassCastException when there is a dynamic template with a
flat_objectmapping and trying to index a document that contains field names with dots.Instead of the ClassCastException, this PR will still fail the request but with a more descriptive error message saying that dots in field names is forbidden using a dynamic template with
flat_objectmapping. This is similar to existing behavior with dynamic templates with anestedmapping. See similar test.Related Issues
Resolves #12298
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.