浏览代码

ESQL: Hide spatial grid functions behind SNAPSHOT (#129839)

#125143 added 9 spatial grid functions and released them into Serverless. We think this is not the best long-term approach and the functions in #129581 are likely better.

As a first step, rmove the spatial grid functions added in #125143 from release builds so they don't get released into 8.19/9.1.

---------

Co-authored-by: Craig Taverner <craig@amanzi.com>
Alexander Spies 3 月之前
父节点
当前提交
efb1397fe9

+ 0 - 6
docs/changelog/125143.yaml

@@ -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

+ 0 - 9
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)

+ 0 - 26
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
-:::

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 1 - 1
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
 }

+ 1 - 1
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

@@ -382,7 +382,7 @@ public class EsqlCapabilities {
         /**
          * 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

+ 11 - 11
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java

@@ -401,16 +401,7 @@ public class EsqlFunctionRegistry {
                 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 @@ public class EsqlFunctionRegistry {
                 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() {