Browse Source

ESQL: Drop unused wrapper (#109125)

This isn't used any more.
Nik Everett 1 year ago
parent
commit
6bb687bfb2

+ 2 - 16
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/EsqlExpressionTranslators.java

@@ -53,7 +53,6 @@ import java.time.ZonedDateTime;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.function.Supplier;
 
 import static org.elasticsearch.xpack.esql.core.type.DataTypes.IP;
 import static org.elasticsearch.xpack.esql.core.type.DataTypes.UNSIGNED_LONG;
@@ -376,26 +375,13 @@ public final class EsqlExpressionTranslators {
             );
         }
 
-        /**
-         * We should normally be using the real `wrapFunctionQuery` above, so we get the benefits of `SingleValueQuery`,
-         * but at the moment `SingleValueQuery` makes use of `SortDocValues` to determine if the results are single or multi-valued,
-         * and LeafShapeFieldData does not support `SortedBinaryDocValues getBytesValues()`.
-         * Skipping this code path entirely is a temporary workaround while separate work is being done to simplify `SingleValueQuery`
-         * to rather rely on a new method on `LeafFieldData`. This is both for the benefit of the spatial queries, as well as an
-         * improvement overall.
-         * TODO: Remove this method and call the parent method once the SingleValueQuery improvements have been made
-         */
-        public static Query wrapFunctionQuery(Supplier<Query> querySupplier) {
-            return querySupplier.get();
-        }
-
         public static Query doTranslate(SpatialRelatesFunction bc, TranslatorHandler handler) {
             if (bc.left().foldable()) {
                 checkSpatialRelatesFunction(bc.left(), bc.queryRelation());
-                return wrapFunctionQuery(() -> translate(bc, handler, bc.right(), bc.left()));
+                return translate(bc, handler, bc.right(), bc.left());
             } else {
                 checkSpatialRelatesFunction(bc.right(), bc.queryRelation());
-                return wrapFunctionQuery(() -> translate(bc, handler, bc.left(), bc.right()));
+                return translate(bc, handler, bc.left(), bc.right());
             }
         }