-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Simplify ignore_malformed handling for synthetic souce in aggregate_metric_double #109888
Simplify ignore_malformed handling for synthetic souce in aggregate_metric_double #109888
Conversation
* 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 { |
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.
This is all from #109882.
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
@elasticmachine update branch |
} | ||
|
||
if (malformedDataForSyntheticSource != null) { | ||
context.doc().add(IgnoreMalformedStoredValues.storedField(name(), malformedDataForSyntheticSource)); | ||
} |
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.
This blocks gets repeated, consider moving it to a helper in IgnoreMalformedStoredValues
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.
I'll leave it if you don't mind i don't think it's too bad of a repetition.
name(), | ||
new AggregateMetricSyntheticFieldLoader(name(), simpleName(), metrics), | ||
new CompositeSyntheticFieldLoader.MalformedValuesLayer(name()) | ||
); |
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.
Cute :)
@@ -779,7 +779,7 @@ public void write(XContentBuilder b) throws IOException { | |||
if (metricHasValue.isEmpty()) { | |||
return; | |||
} | |||
b.startObject(simpleName); |
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.
Similar question, why do we need this?
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.
See #109882.
|
||
- match: | ||
_source: | ||
metric: [{"min": 18.2,"max": 100.0, "value_count": 1}, "hey", 123, 456] |
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.
Similar comment about missing the [123, 456]
pair.
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.
See #109882.
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.
👍
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.