Derived source. Do not initialise parent object during _source reconstruction when document does not have field with some value#21889
Conversation
…truction when document does not have field with some value Signed-off-by: Oleksander Vyshnevskyi <a.vishnevsky.mail@gmail.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 1623df0.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
❌ Gradle check result for 1623df0: 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? |
| } | ||
| } | ||
|
|
||
| public static final class LazyXContentBuilder extends XContentBuilder { |
There was a problem hiding this comment.
This is the simplest possible and minimalistic solution i was able to produce, but a bit dirty.
Likely better option here would be to introduce an interface for XContentBuilder and avoid direct inheritance ( too big change to pull it out from start in first PR without discussion :) )
Description
Lazy parent object initialisation in
org.opensearch.index.mapper.ObjectMapper, that prevents empty objects during _source reconstruction.Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.