Use FallbackSyntheticSourceBlockLoader for number fields#122280
Use FallbackSyntheticSourceBlockLoader for number fields#122280lkts merged 9 commits intoelastic:mainfrom
Conversation
| } | ||
|
|
||
| MappedFieldType ft = new NumberFieldType(context.buildFullName(leafName()), this); | ||
| MappedFieldType ft = new NumberFieldType(context.buildFullName(leafName()), this, context.isSourceSynthetic()); |
There was a problem hiding this comment.
I have to do this because this PR will be backported and in 8.x _source.mode parameter is still operational.
|
Hi @lkts, I've created a changelog YAML for you. |
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
martijnvg
left a comment
There was a problem hiding this comment.
LGTM 👍
Great to see how this new block loader improves performance compared to the source based block loader.
| @@ -0,0 +1,3 @@ | |||
| package org.elasticsearch.benchmark.index.mapper; | |||
|
|
|||
| public class FallbackSyntheticSourceBlockLoaderBenchmark {} | |||
There was a problem hiding this comment.
Is the intend to include the benchmark?
There was a problem hiding this comment.
I didn't intend to do that, i am not sure how this ended up being here :)
| var converted = type.parse(value, coerce); | ||
| accumulator.add(converted); | ||
| } catch (Exception e) { | ||
| // Malformed value, skip it |
There was a problem hiding this comment.
I think this is ok and it matches with the behavior of ignore malformed in es|ql? If a value is malformed it isn't available in doc values and never gets returned by the block loader.
There was a problem hiding this comment.
Yes, we do the same for stored source.
| // Transform number to correct type (e.g. reduce precision) | ||
| accumulator.add(type.parse(rawValue, coerce)); | ||
| } catch (Exception e) { | ||
| // Malformed value, skip it./gradlew ":server:test" --tests |
There was a problem hiding this comment.
Remove ./gradlew ":server:test" --tests ?
|
|
||
| package org.elasticsearch.index.mapper.blockloader; | ||
|
|
||
| import org.elasticsearch.logsdb.datageneration.FieldType; |
There was a problem hiding this comment.
I think we should graduate the datageneration package out of logsdb at some point.
There was a problem hiding this comment.
I even have a PR for that but i've been changing things there and it was conflicting. I'll merge that in.
💚 Backport successful
|
This PR introduces an implementation of
FallbackSyntheticSourceBlockLoaderfor number fields and related tests. This allows to not synthesize entire synthetic_sourcein a block loader when doc_values are not available.unsigned_longandscaled_floatare not covered in this PR.Benchmark results are below (lower is better). Note that we benchmark only
longbut these results should be representable since the implementation is very similar.before
after
Benchmark code
Contributes to #115394.