Support malformed numbers in synthetic _source#90428
Conversation
|
Pinging @elastic/es-analytics-geo (Team:Analytics) |
|
Hi @nik9000, I've created a changelog YAML for you. |
|
Pinging @elastic/es-search (Team:Search) |
This adds support for `ignore_malformed` to numeric fields other than `scaled_float` in synthetic `_source`. Their values are saved to a stored field and loaded to render the `_source`.
| private final Function<Number, Number> round; | ||
| private final Long nullValue = usually() ? null : randomNumber().longValue(); | ||
| private final boolean coerce = rarely(); | ||
| private final boolean ignoreMalformed = rarely(); |
There was a problem hiding this comment.
Do we have a specific test for this somewhere?
There was a problem hiding this comment.
It's run rarely like null value support or coerce or whatever. I could could run it on each run in a new test if you'd like. That way we're more likely to catch regressions faster....
There was a problem hiding this comment.
Yeah, I think I'd be happier with explicit tests for each configuration.
There was a problem hiding this comment.
I've opened #90565 so we'll have known examples to test in addition to some tests each iteration.
…ed_numbers' into synthetic_source_ignore_malformed_numbers
nik9000
left a comment
There was a problem hiding this comment.
@romseygeek could you have another look at this one now that I've merged in my ignore_malformed testing?
| } | ||
|
|
||
| @Override | ||
| protected SyntheticSourceSupport syntheticSourceSupport() { |
There was a problem hiding this comment.
Pulled into a class so it's easier to read. sorry about the big diff.
| private final InetAddress nullValue = usually() ? null : randomIp(randomBoolean()); | ||
| private final boolean ignoreMalformed = rarely(); | ||
| protected SyntheticSourceSupport syntheticSourceSupport(boolean ignoreMalformed) { | ||
| return new IpSyntheticSourceSupport(ignoreMalformed); |
There was a problem hiding this comment.
I've moved this to a named class so it'd be a bit easier to read.
romseygeek
left a comment
There was a problem hiding this comment.
LGTM, thanks for extending the test coverage.
| return new SyntheticSourceExample(in, out, this::mapping); | ||
| } | ||
| protected SyntheticSourceSupport syntheticSourceSupport(boolean ignoreMalformed) { | ||
| assumeFalse("scaled_float doesn't support ignore_above with synthetic _source", ignoreMalformed); |
There was a problem hiding this comment.
ignore_malformed not ignore_above, right?
This adds support for
ignore_malformedto numeric fields other thanscaled_floatin synthetic_source. Their values are saved to a stored field and loaded to render the_source.