From 97b37d1367bf983c3d7ecaae94aefe2927c4bc83 Mon Sep 17 00:00:00 2001 From: Alexander Spies Date: Mon, 23 Jun 2025 11:19:38 +0200 Subject: [PATCH 1/6] Hide spatial grid fcts behind SNAPSHOT --- .../xpack/esql/action/EsqlCapabilities.java | 2 +- .../function/EsqlFunctionRegistry.java | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java index a59df618641de..9a8b71e8e5eea 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java @@ -382,7 +382,7 @@ public enum Cap { /** * Support ST_GEOHASH, ST_GEOTILE and ST_GEOHEX functions */ - SPATIAL_GRID, + SPATIAL_GRID(Build.current().isSnapshot()), /** * Fix to GROK and DISSECT that allows extracting attributes with the same name as the input diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java index b115eb5c33c6e..bf6affb49a0b2 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java @@ -401,16 +401,7 @@ private static FunctionDefinition[][] functions() { def(StYMax.class, StYMax::new, "st_ymax"), def(StYMin.class, StYMin::new, "st_ymin"), def(StX.class, StX::new, "st_x"), - def(StY.class, StY::new, "st_y"), - def(StGeohash.class, StGeohash::new, "st_geohash"), - def(StGeohashToLong.class, StGeohashToLong::new, "st_geohash_to_long"), - def(StGeohashToString.class, StGeohashToString::new, "st_geohash_to_string"), - def(StGeotile.class, StGeotile::new, "st_geotile"), - def(StGeotileToLong.class, StGeotileToLong::new, "st_geotile_to_long"), - def(StGeotileToString.class, StGeotileToString::new, "st_geotile_to_string"), - def(StGeohex.class, StGeohex::new, "st_geohex"), - def(StGeohexToLong.class, StGeohexToLong::new, "st_geohex_to_long"), - def(StGeohexToString.class, StGeohexToString::new, "st_geohex_to_string") }, + def(StY.class, StY::new, "st_y") }, // conditional new FunctionDefinition[] { def(Case.class, Case::new, "case") }, // null @@ -487,7 +478,16 @@ private static FunctionDefinition[][] snapshotFunctions() { def(LastOverTime.class, LastOverTime::withUnresolvedTimestamp, "last_over_time"), def(FirstOverTime.class, FirstOverTime::withUnresolvedTimestamp, "first_over_time"), def(Term.class, bi(Term::new), "term"), - def(Knn.class, tri(Knn::new), "knn") } }; + def(Knn.class, tri(Knn::new), "knn"), + def(StGeohash.class, StGeohash::new, "st_geohash"), + def(StGeohashToLong.class, StGeohashToLong::new, "st_geohash_to_long"), + def(StGeohashToString.class, StGeohashToString::new, "st_geohash_to_string"), + def(StGeotile.class, StGeotile::new, "st_geotile"), + def(StGeotileToLong.class, StGeotileToLong::new, "st_geotile_to_long"), + def(StGeotileToString.class, StGeotileToString::new, "st_geotile_to_string"), + def(StGeohex.class, StGeohex::new, "st_geohex"), + def(StGeohexToLong.class, StGeohexToLong::new, "st_geohex_to_long"), + def(StGeohexToString.class, StGeohexToString::new, "st_geohex_to_string") } }; } public EsqlFunctionRegistry snapshotRegistry() { From 6dbd5e616c08129dae6d43cfd4d113ad6925a5d8 Mon Sep 17 00:00:00 2001 From: Alexander Spies Date: Mon, 23 Jun 2025 11:27:02 +0200 Subject: [PATCH 2/6] Update docs/changelog/129839.yaml --- docs/changelog/129839.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/changelog/129839.yaml diff --git a/docs/changelog/129839.yaml b/docs/changelog/129839.yaml new file mode 100644 index 0000000000000..099e38c61b100 --- /dev/null +++ b/docs/changelog/129839.yaml @@ -0,0 +1,12 @@ +pr: 129839 +summary: Hide spatial grid functions behind SNAPSHOT +area: ES|QL +type: breaking +issues: [] +breaking: + title: Hide spatial grid functions behind SNAPSHOT + area: ES|QL + details: Please describe the details of this change for the release notes. You can + use asciidoc. + impact: Please describe the impact of this change to users + notable: false From a25439cc4e91685eb7c68e66854b08c680e44509 Mon Sep 17 00:00:00 2001 From: Alexander Spies Date: Mon, 23 Jun 2025 11:31:41 +0200 Subject: [PATCH 3/6] Remove documentation for the unreleased functions --- .../esql/_snippets/lists/spatial-functions.md | 9 ------- .../functions-operators/spatial-functions.md | 26 ------------------- 2 files changed, 35 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/lists/spatial-functions.md b/docs/reference/query-languages/esql/_snippets/lists/spatial-functions.md index 763c45ba92460..83cfdd4c60867 100644 --- a/docs/reference/query-languages/esql/_snippets/lists/spatial-functions.md +++ b/docs/reference/query-languages/esql/_snippets/lists/spatial-functions.md @@ -10,12 +10,3 @@ * [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_GEOTILE_TO_STRING`](../../functions-operators/spatial-functions.md#esql-st_geotile_to_string) - * [preview] [`ST_GEOTILE_TO_LONG`](../../functions-operators/spatial-functions.md#esql-st_geotile_to_long) -* [preview] [`ST_GEOHEX`](../../functions-operators/spatial-functions.md#esql-st_geohex) - * [preview] [`ST_GEOHEX_TO_STRING`](../../functions-operators/spatial-functions.md#esql-st_geohex_to_string) - * [preview] [`ST_GEOHEX_TO_LONG`](../../functions-operators/spatial-functions.md#esql-st_geohex_to_long) -* [preview] [`ST_GEOHASH`](../../functions-operators/spatial-functions.md#esql-st_geohash) - * [preview] [`ST_GEOHASH_TO_STRING`](../../functions-operators/spatial-functions.md#esql-st_geohash_to_string) - * [preview] [`ST_GEOHASH_TO_LONG`](../../functions-operators/spatial-functions.md#esql-st_geohash_to_long) diff --git a/docs/reference/query-languages/esql/functions-operators/spatial-functions.md b/docs/reference/query-languages/esql/functions-operators/spatial-functions.md index 912401a3c0161..806e5e8157a63 100644 --- a/docs/reference/query-languages/esql/functions-operators/spatial-functions.md +++ b/docs/reference/query-languages/esql/functions-operators/spatial-functions.md @@ -48,29 +48,3 @@ mapped_pages: :::{include} ../_snippets/functions/layout/st_ymin.md ::: -:::{include} ../_snippets/functions/layout/st_geotile.md -::: - -:::{include} ../_snippets/functions/layout/st_geotile_to_string.md -::: - -:::{include} ../_snippets/functions/layout/st_geotile_to_long.md -::: - -:::{include} ../_snippets/functions/layout/st_geohex.md -::: - -:::{include} ../_snippets/functions/layout/st_geohex_to_string.md -::: - -:::{include} ../_snippets/functions/layout/st_geohex_to_long.md -::: - -:::{include} ../_snippets/functions/layout/st_geohash.md -::: - -:::{include} ../_snippets/functions/layout/st_geohash_to_string.md -::: - -:::{include} ../_snippets/functions/layout/st_geohash_to_long.md -::: From 8b10d865762b53586026da9698797ad1679694dc Mon Sep 17 00:00:00 2001 From: Alexander Spies Date: Mon, 23 Jun 2025 11:57:47 +0200 Subject: [PATCH 4/6] Delete docs/changelog/129839.yaml --- docs/changelog/129839.yaml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 docs/changelog/129839.yaml diff --git a/docs/changelog/129839.yaml b/docs/changelog/129839.yaml deleted file mode 100644 index 099e38c61b100..0000000000000 --- a/docs/changelog/129839.yaml +++ /dev/null @@ -1,12 +0,0 @@ -pr: 129839 -summary: Hide spatial grid functions behind SNAPSHOT -area: ES|QL -type: breaking -issues: [] -breaking: - title: Hide spatial grid functions behind SNAPSHOT - area: ES|QL - details: Please describe the details of this change for the release notes. You can - use asciidoc. - impact: Please describe the impact of this change to users - notable: false From 6f8a3deee744f51f57ec7bc6ae8cddaee79bbc23 Mon Sep 17 00:00:00 2001 From: Alexander Spies Date: Mon, 23 Jun 2025 11:59:27 +0200 Subject: [PATCH 5/6] Remove obsolete changelog files This doesn't apply to stateful at all. --- docs/changelog/125143.yaml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 docs/changelog/125143.yaml diff --git a/docs/changelog/125143.yaml b/docs/changelog/125143.yaml deleted file mode 100644 index 83e15973f9932..0000000000000 --- a/docs/changelog/125143.yaml +++ /dev/null @@ -1,6 +0,0 @@ -pr: 125143 -summary: "ES|QL Support for ST_GEOHASH, ST_GEOTILE and ST_GEOHEX" -area: "ES|QL" -type: enhancement -issues: - - 123903 From 52be67fad3d4386215624f5ba4cdd9d01b3b6744 Mon Sep 17 00:00:00 2001 From: Craig Taverner Date: Mon, 23 Jun 2025 12:10:56 +0200 Subject: [PATCH 6/6] Update Kibana docs with snapshot_only:true --- .../esql/kibana/definition/functions/st_geohash.json | 2 +- .../esql/kibana/definition/functions/st_geohash_to_long.json | 2 +- .../esql/kibana/definition/functions/st_geohash_to_string.json | 2 +- .../esql/kibana/definition/functions/st_geohex.json | 2 +- .../esql/kibana/definition/functions/st_geohex_to_long.json | 2 +- .../esql/kibana/definition/functions/st_geohex_to_string.json | 2 +- .../esql/kibana/definition/functions/st_geotile.json | 2 +- .../esql/kibana/definition/functions/st_geotile_to_long.json | 2 +- .../esql/kibana/definition/functions/st_geotile_to_string.json | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash.json index d9f5a981e5108..e019d408667ef 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash.json @@ -51,5 +51,5 @@ "FROM airports\n| EVAL geohash = ST_GEOHASH(location, 1)\n| STATS\n count = COUNT(*),\n centroid = ST_CENTROID_AGG(location)\n BY geohash\n| WHERE count >= 10\n| EVAL geohashString = ST_GEOHASH_TO_STRING(geohash)\n| KEEP count, centroid, geohashString\n| SORT count DESC, geohashString ASC" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true } diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash_to_long.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash_to_long.json index 27f0048ba4e43..024d03b16e6be 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash_to_long.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash_to_long.json @@ -33,5 +33,5 @@ "ROW geohash = \"u3bu\"\n| EVAL geohashLong = ST_GEOHASH_TO_LONG(geohash)" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true } diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash_to_string.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash_to_string.json index 07d3e57f13a7e..dc3c6529f07eb 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash_to_string.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohash_to_string.json @@ -33,5 +33,5 @@ "ROW geohash = TO_LONG(13686180)\n| EVAL geohashString = ST_GEOHASH_TO_STRING(geohash)" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true } diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex.json index e172f317b3e4d..cd0d7d3b82f1c 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex.json @@ -54,5 +54,5 @@ "FROM airports\n| EVAL geohex = ST_GEOHEX(location, 1)\n| STATS\n count = COUNT(*),\n centroid = ST_CENTROID_AGG(location)\n BY geohex\n| WHERE count >= 10\n| EVAL geohexString = ST_GEOHEX_TO_STRING(geohex)\n| KEEP count, centroid, geohexString\n| SORT count DESC, geohexString ASC" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true } diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex_to_long.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex_to_long.json index a7733bf4cee2f..b08a5c62e5a47 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex_to_long.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex_to_long.json @@ -33,5 +33,5 @@ "ROW geohex = \"841f059ffffffff\"\n| EVAL geohexLong = ST_GEOHEX_TO_LONG(geohex)" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true } diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex_to_string.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex_to_string.json index 757876b43d6ba..e787931fdb8e1 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex_to_string.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geohex_to_string.json @@ -33,5 +33,5 @@ "ROW geohex = 595020895127339007\n| EVAL geohexString = ST_GEOHEX_TO_STRING(geohex)" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true } diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile.json index a77236dd6a592..64e8f9cfea9ab 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile.json @@ -51,5 +51,5 @@ "FROM airports\n| EVAL geotile = ST_GEOTILE(location, 2)\n| STATS\n count = COUNT(*),\n centroid = ST_CENTROID_AGG(location)\n BY geotile\n| EVAL geotileString = ST_GEOTILE_TO_STRING(geotile)\n| SORT count DESC, geotileString ASC\n| KEEP count, centroid, geotileString" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true } diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile_to_long.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile_to_long.json index 74dc9021a0bd6..407117a5c0b26 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile_to_long.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile_to_long.json @@ -33,5 +33,5 @@ "ROW geotile = \"4/8/5\"\n| EVAL geotileLong = ST_GEOTILE_TO_LONG(geotile)" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true } diff --git a/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile_to_string.json b/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile_to_string.json index 23eeb00ac65e5..c27faa68049de 100644 --- a/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile_to_string.json +++ b/docs/reference/query-languages/esql/kibana/definition/functions/st_geotile_to_string.json @@ -33,5 +33,5 @@ "ROW geotile = 1152921508901814277\n| EVAL geotileString = ST_GEOTILE_TO_STRING(geotile)" ], "preview" : false, - "snapshot_only" : false + "snapshot_only" : true }