Skip to content

Commit 3e17ce4

Browse files
committed
ESQL - remove some dead code (elastic#123720)
I was looking at some unrelated stuff in the Function Registry, and noticed this was never called.
1 parent fac783e commit 3e17ce4

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
package org.elasticsearch.xpack.esql.expression.function;
99

1010
import org.elasticsearch.Build;
11-
import org.elasticsearch.common.Strings;
1211
import org.elasticsearch.common.util.CollectionUtils;
1312
import org.elasticsearch.common.util.FeatureFlag;
1413
import org.elasticsearch.xpack.esql.core.QlIllegalArgumentException;
@@ -163,12 +162,9 @@
163162
import java.util.Locale;
164163
import java.util.Map;
165164
import java.util.function.BiFunction;
166-
import java.util.regex.Pattern;
167165
import java.util.stream.Collectors;
168166

169-
import static java.util.Collections.emptyList;
170167
import static java.util.Collections.unmodifiableList;
171-
import static java.util.stream.Collectors.toList;
172168
import static org.elasticsearch.xpack.esql.core.type.DataType.BOOLEAN;
173169
import static org.elasticsearch.xpack.esql.core.type.DataType.CARTESIAN_POINT;
174170
import static org.elasticsearch.xpack.esql.core.type.DataType.CARTESIAN_SHAPE;
@@ -269,16 +265,6 @@ public Collection<FunctionDefinition> listFunctions() {
269265
return defs.values();
270266
}
271267

272-
public Collection<FunctionDefinition> listFunctions(String pattern) {
273-
// It is worth double checking if we need this copy. These are immutable anyway.
274-
Pattern p = Strings.hasText(pattern) ? Pattern.compile(normalize(pattern)) : null;
275-
return defs.entrySet()
276-
.stream()
277-
.filter(e -> p == null || p.matcher(e.getKey()).matches())
278-
.map(e -> cloneDefinition(e.getKey(), e.getValue()))
279-
.collect(toList());
280-
}
281-
282268
private static FunctionDefinition[][] functions() {
283269
return new FunctionDefinition[][] {
284270
// grouping functions
@@ -794,10 +780,6 @@ protected void buildDataTypesForStringLiteralConversion(FunctionDefinition[]...
794780
}
795781
}
796782

797-
protected FunctionDefinition cloneDefinition(String name, FunctionDefinition definition) {
798-
return new FunctionDefinition(name, emptyList(), definition.clazz(), definition.builder());
799-
}
800-
801783
protected interface FunctionBuilder {
802784
Function build(Source source, List<Expression> children, Configuration cfg);
803785
}

0 commit comments

Comments
 (0)