Improve block loader for source only runtime fields of type double.#134629
Merged
martijnvg merged 5 commits intoelastic:mainfrom Sep 12, 2025
Merged
Conversation
By using the FallbackSyntheticSourceBlockLoader instead of generic DoubleScriptBlockLoader. Relates to elastic#134121
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
8 tasks
Collaborator
|
Hi @martijnvg, I've created a changelog YAML for you. |
romseygeek
reviewed
Sep 12, 2025
| public BlockLoader blockLoader(BlockLoaderContext blContext) { | ||
| return new DoubleScriptBlockDocValuesReader.DoubleScriptBlockLoader(leafFactory(blContext.lookup())); | ||
| var indexSettings = blContext.indexSettings(); | ||
| if (isParsedFromSource && indexSettings.getIndexMappingSourceMode() == SourceFieldMapper.Mode.SYNTHETIC |
Member
Author
There was a problem hiding this comment.
This is how spotless formatted it :) I fixed the indentation, but since I copied from long script field type, I generalized the logic, it should be reusable for other runtime field types as well.
| // In that case there is no ignored source entry, and so we need to fail back to LongScriptBlockLoader. | ||
| // We could optimize this, but at this stage feels like a rare scenario. | ||
| && blContext.lookup().onlyMappedAsRuntimeField(name())) { | ||
| var reader = new NumberType.NumberFallbackSyntheticSourceReader(NumberType.DOUBLE, null, true) { |
Contributor
There was a problem hiding this comment.
Do we have a test for this code path?
Member
Author
There was a problem hiding this comment.
Yes, this is tested in the testBlockLoaderSourceOnlyRuntimeFieldWithSyntheticSource() test, which is also included in this change.
Member
Author
|
Note that this change should yield similar improvement as: #134117 (comment) |
…double_runtime_field
mridula-s109
pushed a commit
to mridula-s109/elasticsearch
that referenced
this pull request
Sep 17, 2025
…lastic#134629) By using the FallbackSyntheticSourceBlockLoader instead of generic DoubleScriptBlockLoader. Relates to elastic#134121
gmjehovich
pushed a commit
to gmjehovich/elasticsearch
that referenced
this pull request
Sep 18, 2025
…lastic#134629) By using the FallbackSyntheticSourceBlockLoader instead of generic DoubleScriptBlockLoader. Relates to elastic#134121
phananh1010
added a commit
to phananh1010/elasticsearch
that referenced
this pull request
Oct 2, 2025
BASE=abd8b324ee1890ff50e34db656d9ed1d3f3e62d4 HEAD=45a5e24aa565598fb91e2933213d81e462ab103e Branch=main
phananh1010
added a commit
to phananh1010/elasticsearch
that referenced
this pull request
Oct 6, 2025
BASE=abd8b324ee1890ff50e34db656d9ed1d3f3e62d4 HEAD=45a5e24aa565598fb91e2933213d81e462ab103e Branch=main
phananh1010
added a commit
to phananh1010/elasticsearch
that referenced
this pull request
Oct 17, 2025
BASE=abd8b324ee1890ff50e34db656d9ed1d3f3e62d4 HEAD=45a5e24aa565598fb91e2933213d81e462ab103e Branch=main
phananh1010
added a commit
to phananh1010/elasticsearch
that referenced
this pull request
Oct 23, 2025
BASE=abd8b324ee1890ff50e34db656d9ed1d3f3e62d4 HEAD=45a5e24aa565598fb91e2933213d81e462ab103e Branch=main
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.
By using the FallbackSyntheticSourceBlockLoader instead of generic DoubleScriptBlockLoader.
Relates to #134121