Simplify ignore_malformed handling for synthetic souce in aggregate_metric_double#109888
Merged
lkts merged 3 commits intoelastic:mainfrom Jun 20, 2024
Merged
Conversation
lkts
commented
Jun 18, 2024
| * Typical use case is to gather field values from doc_values and append malformed values | ||
| * stored in a different field in case of ignore_malformed being enabled. | ||
| */ | ||
| public class CompositeSyntheticFieldLoader implements SourceLoader.SyntheticFieldLoader { |
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
Contributor
Author
|
@elasticmachine update branch |
kkrik-es
reviewed
Jun 20, 2024
|
|
||
| if (malformedDataForSyntheticSource != null) { | ||
| context.doc().add(IgnoreMalformedStoredValues.storedField(name(), malformedDataForSyntheticSource)); | ||
| } |
Member
There was a problem hiding this comment.
This blocks gets repeated, consider moving it to a helper in IgnoreMalformedStoredValues
Contributor
Author
There was a problem hiding this comment.
I'll leave it if you don't mind i don't think it's too bad of a repetition.
kkrik-es
reviewed
Jun 20, 2024
| name(), | ||
| new AggregateMetricSyntheticFieldLoader(name(), simpleName(), metrics), | ||
| new CompositeSyntheticFieldLoader.MalformedValuesLayer(name()) | ||
| ); |
kkrik-es
reviewed
Jun 20, 2024
| if (metricHasValue.isEmpty()) { | ||
| return; | ||
| } | ||
| b.startObject(simpleName); |
Member
There was a problem hiding this comment.
Similar question, why do we need this?
kkrik-es
reviewed
Jun 20, 2024
|
|
||
| - match: | ||
| _source: | ||
| metric: [{"min": 18.2,"max": 100.0, "value_count": 1}, "hey", 123, 456] |
Member
There was a problem hiding this comment.
Similar comment about missing the [123, 456] pair.
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.
This PR reworks the logic to follow the pattern from #109882. This also fixes the edge case of array of values some of which are malformed.