Skip to content

Commit 27e02a9

Browse files
ST_GEOHEX fix for excessive object creation in bounded grids (#130343)
Use new objects per thread instead of per record * Expand tests to use random bounds, after multi-thread fix * Also fix an issue around nulls for out-of-bounds results * And investigate and affirm that the use of -1 internally to mark invalid grid-ids is fine for all three grid types (ie. -1 is not a valid grid-id in any of these cases, for different reasons in each).
1 parent 1126129 commit 27e02a9

File tree

14 files changed

+173
-95
lines changed

14 files changed

+173
-95
lines changed

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeohashFromFieldAndLiteralAndLiteralEvaluator.java

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeohashFromFieldDocValuesAndLiteralAndLiteralEvaluator.java

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeohexFromFieldAndLiteralAndLiteralEvaluator.java

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeohexFromFieldDocValuesAndLiteralAndLiteralEvaluator.java

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeotileFromFieldAndLiteralAndLiteralEvaluator.java

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/generated/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/StGeotileFromFieldDocValuesAndLiteralAndLiteralEvaluator.java

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/GeoHexBoundedPredicate.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,15 @@
1717
public class GeoHexBoundedPredicate {
1818

1919
private final boolean crossesDateline;
20-
private final GeoBoundingBox bbox;
20+
private final GeoBoundingBox bbox, scratch;
2121

2222
GeoHexBoundedPredicate(GeoBoundingBox bbox) {
2323
this.crossesDateline = bbox.right() < bbox.left();
24-
// TODO remove this once we get serverless flaky tests to pass
25-
// assert this.crossesDateline == false;
2624
this.bbox = bbox;
25+
this.scratch = new GeoBoundingBox(new org.elasticsearch.common.geo.GeoPoint(), new org.elasticsearch.common.geo.GeoPoint());
2726
}
2827

2928
public boolean validHex(long hex) {
30-
GeoBoundingBox scratch = new GeoBoundingBox(
31-
new org.elasticsearch.common.geo.GeoPoint(),
32-
new org.elasticsearch.common.geo.GeoPoint()
33-
);
3429
H3SphericalUtil.computeGeoBounds(hex, scratch);
3530
if (bbox.top() > scratch.bottom() && bbox.bottom() < scratch.top()) {
3631
if (scratch.left() > scratch.right()) {

0 commit comments

Comments
 (0)