- Notifications
You must be signed in to change notification settings - Fork25.6k
Fixed geo point block loader slowness#136147
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Hi@Kubik42, I've created a changelog YAML for you. |
e7afa0b
to1f168f2
Compareserver/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.javaShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Kubik42 commentedOct 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The reason for failing tests ishere. Whenever there is no Perhaps the bigger problem here is that |
Kubik42 commentedOct 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
In my rabbit hole of understanding how BlockLoaders work, I found a somewhat of a bug thats in main. When a For example, the following command fails:
with:
Based on what I've read in the code, this precision loss isexpected. That being said, its not documentedpublicly. |
Kubik42 commentedOct 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There is also a problem with using When block loading, I get the error: My guess is that it has something to do with the geo_point being stored as a String, rather than being converted to WKT first. That said, even when I used For now, I've just followed what we do inGeoShapeWithDocValuesFieldMapper and changed the block loader to This needs further discussion. |
1f168f2
tob586f4c
Compare} | ||
if (store) { | ||
context.doc().add(newStoredField(fieldType().name(),geometry.toString())); | ||
context.doc() |
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 don't think we should be changing how geo points are stored as stored fields.
If compute engine is expecting a different type with NONE field extract preference, maybe we should just give that without falling back to source based block loader? By implementing a different block loader for this case that mimics what its synthetic source support does?
I think want to implement a block loader that return WKB binary format that is converted from numeric doc values. This is kind of what happens now with source based block loader for geoip field type (but then by synthesizing all fields).
Kubik42 commentedOct 9, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I did a little more investigating and found that the reason we end up with This got me thinking, why are we setting the preference to
However, doing so causes some type inequality exceptions. Nhat pointed outthis code, which suggests that doc_values shouldn't be always be used. However, that conflicts with the definition of |
e9ba832
to7176d9e
Compare7176d9e
to8573b2f
Compare4fa26e3
to4ee4a46
Compareadc51f9
to5cedfba
CompareThere 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 left a few comments.
server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.javaShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
* This implies that we need to load the value from _source. This however is very slow, especially when synthetic source is enabled. | ||
* We're better off reading from doc_values and converting to BytesRef to satisfy the checker. This is what this block loader is for. | ||
*/ | ||
staticclassBytesRefFromLongsBlockLoaderextendsBlockDocValuesReader.DocValuesBlockLoader { |
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.
seal classes?
privatefinalbooleanhasDocValuesSkipper; | ||
privateIndexType( | ||
IndexType( |
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 don't think is intended even for tests. Can you use one of the static methods in this class?
} | ||
@Override | ||
publicTestBlockbuild() { |
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.
why can this be removed now?
// then | ||
// verify that we use the correct block value reader | ||
assertThat(loader,instanceOf(BlockSourceReader.GeometriesBlockLoader.class)); |
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.
Maybe I misunderstand this, but stored field and stored preference is handled yet in the block loader method?
This addresses#135891
TODO: write up explanation of what went wrong and his this PR fixes it