Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d8d58c9
Move geo-grid functions out of SNAPSHOT and into tech-preview
craigtaverner Sep 5, 2025
fd1ef72
Update license tests to assert functions now work in release build
craigtaverner Sep 5, 2025
8584eb5
Regenerated docs to get kibana JSON snapshot flags fixed
craigtaverner Sep 5, 2025
f7fe838
Merge branch 'main' into geogrid_tech_preview
craigtaverner Sep 5, 2025
8c3b1b6
Fix docs links
craigtaverner Sep 6, 2025
6429eec
Fixed release function count
craigtaverner Sep 6, 2025
c6d1435
Merge branch 'main' into geogrid_tech_preview
craigtaverner Sep 6, 2025
bd7508b
Update kibana docs after tiny geo-grid docs change
craigtaverner Sep 6, 2025
2fff33a
Fix a number of release tests after KNN PRs merged
craigtaverner Sep 6, 2025
9677d53
Merge branch 'geogrid_tech_preview' of github.com:craigtaverner/elast…
craigtaverner Sep 6, 2025
06a539b
Merge remote-tracking branch 'origin/main' into geogrid_tech_preview
craigtaverner Sep 6, 2025
bcaa104
Merge remote-tracking branch 'origin/main' into geogrid_tech_preview
craigtaverner Sep 8, 2025
c63d854
Fix docs links
craigtaverner Sep 8, 2025
0996733
Remove incorrect optional flag from StGeohash
craigtaverner Sep 8, 2025
b7e07d2
Link to original aggs docs for more detail on the tile key format
craigtaverner Sep 8, 2025
2a35c50
Fix stale comment
craigtaverner Sep 8, 2025
3ca4e5b
Merge branch 'main' into geogrid_tech_preview
craigtaverner Sep 8, 2025
0871e63
Merge remote-tracking branch 'origin/main' into geogrid_tech_preview
craigtaverner Sep 9, 2025
74dffdf
Require capability for DECAY function
craigtaverner Sep 9, 2025
f269dbc
Merge remote-tracking branch 'origin/main' into geogrid_tech_preview
craigtaverner Sep 9, 2025
be1ed50
Merge remote-tracking branch 'origin/main' into geogrid_tech_preview
craigtaverner Sep 9, 2025
a98d94f
Regenerate SVG after merging main
craigtaverner Sep 9, 2025
829fb01
Regenerate SVG after merging main
craigtaverner Sep 9, 2025
3d59cef
Merge remote-tracking branch 'origin/main' into geogrid_tech_preview
craigtaverner Sep 9, 2025
5e966f3
Update usage count after merging main
craigtaverner Sep 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
* [preview] [`ST_XMIN`](../../functions-operators/spatial-functions.md#esql-st_xmin)
* [preview] [`ST_YMAX`](../../functions-operators/spatial-functions.md#esql-st_ymax)
* [preview] [`ST_YMIN`](../../functions-operators/spatial-functions.md#esql-st_ymin)
* [preview] [`ST_GEOTILE`](../../functions-operators/spatial-functions.md#esql-st_geotile)
* [preview] [`ST_GEOHEX`](../../functions-operators/spatial-functions.md#esql-st_geohex)
* [preview] [`ST_GEOHASH`](../../functions-operators/spatial-functions.md#esql-st_geohash)
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
* [`TO_DATE_NANOS`](../../functions-operators/type-conversion-functions.md#esql-to_date_nanos)
* [`TO_DEGREES`](../../functions-operators/type-conversion-functions.md#esql-to_degrees)
* [`TO_DOUBLE`](../../functions-operators/type-conversion-functions.md#esql-to_double)
* [preview] [`TO_GEOHASH`](../../functions-operators/type-conversion-functions.md#esql-to_geohash)
* [preview] [`TO_GEOHEX`](../../functions-operators/type-conversion-functions.md#esql-to_geohex)
* [`TO_GEOPOINT`](../../functions-operators/type-conversion-functions.md#esql-to_geopoint)
* [`TO_GEOSHAPE`](../../functions-operators/type-conversion-functions.md#esql-to_geoshape)
* [preview] [`TO_GEOTILE`](../../functions-operators/type-conversion-functions.md#esql-to_geotile)
* [`TO_INTEGER`](../../functions-operators/type-conversion-functions.md#esql-to_integer)
* [`TO_IP`](../../functions-operators/type-conversion-functions.md#esql-to_ip)
* [`TO_LONG`](../../functions-operators/type-conversion-functions.md#esql-to_long)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ mapped_pages:

:::{include} ../_snippets/functions/layout/st_ymin.md
:::

:::{include} ../_snippets/functions/layout/st_geotile.md
:::

:::{include} ../_snippets/functions/layout/st_geohex.md
:::

:::{include} ../_snippets/functions/layout/st_geohash.md
:::
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,21 @@ mapped_pages:
:::{include} ../_snippets/functions/layout/to_double.md
:::

:::{include} ../_snippets/functions/layout/to_geohash.md
:::

:::{include} ../_snippets/functions/layout/to_geohex.md
:::

:::{include} ../_snippets/functions/layout/to_geopoint.md
:::

:::{include} ../_snippets/functions/layout/to_geoshape.md
:::

:::{include} ../_snippets/functions/layout/to_geotile.md
:::

:::{include} ../_snippets/functions/layout/to_integer.md
:::

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ protected int precision() {
/**
* Test that the geo_grid functions are disabled outside of SNAPSHOT.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: javadoc is stale.

I like this. At first I thought we might as well remove this test, but asserting that the capability is enabled is actually better. Guards against accidentally disabling the capability and not noticing that we broke prod.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the stale comment. I also think I might refine this test a little more when supporting geo_shapes, and it might increase more in value then.

*/
public void testGeoGridDisabled() {
assertGeoGridDisabledWith("index_geo_point");
public void testGeoGridEnabled() {
assertGeoGridEnabled();
}

/**
Expand Down Expand Up @@ -120,16 +120,10 @@ protected void assertGeoGridFailsWith(String index) {
assertThat(e.getMessage(), containsString(expectedError));
}

protected void assertGeoGridDisabledWith(String index) {
assumeFalse("testing feature is disabled in non-snapshot builds", Build.current().isSnapshot());
var query = String.format(Locale.ROOT, """
FROM %s
| EVAL gridId = %s(location, %d)
| STATS count=COUNT() BY gridId
""", index, gridFunction(), precision());
var expectedError = String.format(Locale.ROOT, "Unknown function [%s]", gridFunction());
ElasticsearchException e = expectThrows(VerificationException.class, () -> run(query));
assertThat(e.getMessage(), containsString(expectedError));
protected void assertGeoGridEnabled() {
assumeFalse("testing feature is enabled in non-snapshot builds", Build.current().isSnapshot());
assertThat("Capability SPATIAL_GRID_TYPES should be enabled", EsqlCapabilities.Cap.SPATIAL_GRID_TYPES.isEnabled(), equalTo(true));
testGeoGridWithPoints();
}

public static Map<String, Long> getValuesMap(Iterator<Iterator<Object>> values) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,17 +414,17 @@ public enum Cap {
/**
* Support ST_GEOHASH, ST_GEOTILE and ST_GEOHEX functions
*/
SPATIAL_GRID(Build.current().isSnapshot()),
SPATIAL_GRID,

/**
* Support geohash, geotile and geohex data types. Done in #129581
*/
SPATIAL_GRID_TYPES(Build.current().isSnapshot()),
SPATIAL_GRID_TYPES,

/**
* Support geohash, geotile and geohex in ST_INTERSECTS and ST_DISJOINT. Done in #133546
*/
SPATIAL_GRID_INTERSECTS(Build.current().isSnapshot()),
SPATIAL_GRID_INTERSECTS,

/**
* Fix to GROK and DISSECT that allows extracting attributes with the same name as the input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ private static FunctionDefinition[][] functions() {
def(SpatialWithin.class, SpatialWithin::new, "st_within"),
def(StDistance.class, StDistance::new, "st_distance"),
def(StEnvelope.class, StEnvelope::new, "st_envelope"),
def(StGeohash.class, StGeohash::new, "st_geohash"),
def(StGeotile.class, StGeotile::new, "st_geotile"),
def(StGeohex.class, StGeohex::new, "st_geohex"),
def(StXMax.class, StXMax::new, "st_xmax"),
def(StXMin.class, StXMin::new, "st_xmin"),
def(StYMax.class, StYMax::new, "st_ymax"),
Expand All @@ -445,6 +448,9 @@ private static FunctionDefinition[][] functions() {
def(ToDateNanos.class, ToDateNanos::new, "to_date_nanos", "to_datenanos"),
def(ToDegrees.class, ToDegrees::new, "to_degrees"),
def(ToDouble.class, ToDouble::new, "to_double", "to_dbl"),
def(ToGeohash.class, ToGeohash::new, "to_geohash"),
def(ToGeotile.class, ToGeotile::new, "to_geotile"),
def(ToGeohex.class, ToGeohex::new, "to_geohex"),
def(ToGeoPoint.class, ToGeoPoint::new, "to_geopoint"),
def(ToGeoShape.class, ToGeoShape::new, "to_geoshape"),
def(ToIp.class, ToIp::new, "to_ip"),
Expand Down Expand Up @@ -506,12 +512,6 @@ private static FunctionDefinition[][] snapshotFunctions() {
def(Score.class, uni(Score::new), Score.NAME),
def(Term.class, bi(Term::new), "term"),
def(Knn.class, tri(Knn::new), "knn"),
def(ToGeohash.class, ToGeohash::new, "to_geohash"),
def(ToGeotile.class, ToGeotile::new, "to_geotile"),
def(ToGeohex.class, ToGeohex::new, "to_geohex"),
def(StGeohash.class, StGeohash::new, "st_geohash"),
def(StGeotile.class, StGeotile::new, "st_geotile"),
def(StGeohex.class, StGeohex::new, "st_geohex"),
def(CosineSimilarity.class, CosineSimilarity::new, "v_cosine"),
def(DotProduct.class, DotProduct::new, "v_dot_product"),
def(L1Norm.class, L1Norm::new, "v_l1_norm"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private static int checkPrecisionRange(int precision) {
description = """
Calculates the `geohash` of the supplied geo_point at the specified precision.
The result is long encoded. Use [TO_STRING](#esql-to_string) to convert the result to a string,
[TO_LONG](#esql-to_long) to convert it to a `long`, or [TO_GEOSHAPE](esql-to_geoshape.md) to calculate
[TO_LONG](#esql-to_long) to convert it to a `long`, or [TO_GEOSHAPE](#esql-to_geoshape) to calculate
the `geo_shape` bounding geometry.

These functions are related to the [`geo_grid` query](/reference/query-languages/query-dsl/query-dsl-geo-grid-query.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private static int checkPrecisionRange(int precision) {
description = """
Calculates the `geohex`, the H3 cell-id, of the supplied geo_point at the specified precision.
The result is long encoded. Use [TO_STRING](#esql-to_string) to convert the result to a string,
[TO_LONG](#esql-to_long) to convert it to a `long`, or [TO_GEOSHAPE](esql-to_geoshape.md) to calculate
[TO_LONG](#esql-to_long) to convert it to a `long`, or [TO_GEOSHAPE](#esql-to_geoshape) to calculate
the `geo_shape` bounding geometry.

These functions are related to the [`geo_grid` query](/reference/query-languages/query-dsl/query-dsl-geo-grid-query.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public GeoTileBoundedGrid get(DriverContext context) {
description = """
Calculates the `geotile` of the supplied geo_point at the specified precision.
The result is long encoded. Use [TO_STRING](#esql-to_string) to convert the result to a string,
[TO_LONG](#esql-to_long) to convert it to a `long`, or [TO_GEOSHAPE](esql-to_geoshape.md) to calculate
[TO_LONG](#esql-to_long) to convert it to a `long`, or [TO_GEOSHAPE](#esql-to_geoshape) to calculate
the `geo_shape` bounding geometry.

These functions are related to the [`geo_grid` query](/reference/query-languages/query-dsl/query-dsl-geo-grid-query.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ setup:
- gt: {esql.functions.to_long: $functions_to_long}
- match: {esql.functions.coalesce: $functions_coalesce}
- gt: {esql.functions.categorize: $functions_categorize}
- length: {esql.functions: 142} # check the "sister" test above for a likely update to the same esql.functions length check
- length: {esql.functions: 148} # check the "sister" test above for a likely update to the same esql.functions length check

---
took:
Expand Down