From 54eab979afc34fba89d47b0458e4ca9bed89eb2b Mon Sep 17 00:00:00 2001 From: Mark Tozzi Date: Fri, 28 Feb 2025 10:26:27 -0500 Subject: [PATCH] remove some dead code --- .../function/EsqlFunctionRegistry.java | 18 ------------------ 1 file changed, 18 deletions(-) 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 cb802da11187a..f7683f9b78546 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 @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.esql.expression.function; import org.elasticsearch.Build; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.util.FeatureFlag; import org.elasticsearch.xpack.esql.core.QlIllegalArgumentException; @@ -163,12 +162,9 @@ import java.util.Locale; import java.util.Map; import java.util.function.BiFunction; -import java.util.regex.Pattern; import java.util.stream.Collectors; -import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; -import static java.util.stream.Collectors.toList; import static org.elasticsearch.xpack.esql.core.type.DataType.BOOLEAN; import static org.elasticsearch.xpack.esql.core.type.DataType.CARTESIAN_POINT; import static org.elasticsearch.xpack.esql.core.type.DataType.CARTESIAN_SHAPE; @@ -269,16 +265,6 @@ public Collection listFunctions() { return defs.values(); } - public Collection listFunctions(String pattern) { - // It is worth double checking if we need this copy. These are immutable anyway. - Pattern p = Strings.hasText(pattern) ? Pattern.compile(normalize(pattern)) : null; - return defs.entrySet() - .stream() - .filter(e -> p == null || p.matcher(e.getKey()).matches()) - .map(e -> cloneDefinition(e.getKey(), e.getValue())) - .collect(toList()); - } - private static FunctionDefinition[][] functions() { return new FunctionDefinition[][] { // grouping functions @@ -793,10 +779,6 @@ protected void buildDataTypesForStringLiteralConversion(FunctionDefinition[]... } } - protected FunctionDefinition cloneDefinition(String name, FunctionDefinition definition) { - return new FunctionDefinition(name, emptyList(), definition.clazz(), definition.builder()); - } - protected interface FunctionBuilder { Function build(Source source, List children, Configuration cfg); }