Skip to content

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Feb 1, 2022

There are situation where a grid tile produced by a GeoGridAggregation might cross the dateline. With hex tile is expected but it might happen with geohash as well. In this case, we are not handling properly the tile intersection with the bounds provided by the query.

This PR adds logic to handle those cases in Geohash and Geohex Grid aggregations.

fixes #83299

@iverase iverase added >bug :Analytics/Geo Indexing, search aggregations of geo points and shapes v8.1.0 labels Feb 1, 2022
@iverase iverase requested a review from imotov February 1, 2022 08:03
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 1, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @iverase, I've created a changelog YAML for you.

@iverase
Copy link
Contributor Author

iverase commented Feb 1, 2022

@elasticmachine update branch

@iverase
Copy link
Contributor Author

iverase commented Feb 1, 2022

@elasticmachine update branch

Copy link
Contributor

@imotov imotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

private boolean validHash(String hash) {
final Rectangle rectangle = Geohash.toBoundingBox(hash);
final Rectangle rect = Geohash.toBoundingBox(hash);
if (rect.getMaxX() < rect.getMinX()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole thing could really use a drawing in the comments 😄 .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@iverase iverase merged commit 63ce3af into elastic:master Feb 2, 2022
@iverase iverase deleted the geohexbouds branch February 2, 2022 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] GeoHexAggregatorTests testBounds failing

4 participants