|
8 | 8 | package org.elasticsearch.xpack.esql.expression.function; |
9 | 9 |
|
10 | 10 | import org.elasticsearch.Build; |
11 | | -import org.elasticsearch.common.Strings; |
12 | 11 | import org.elasticsearch.common.util.CollectionUtils; |
13 | 12 | import org.elasticsearch.common.util.FeatureFlag; |
14 | 13 | import org.elasticsearch.xpack.esql.core.QlIllegalArgumentException; |
|
163 | 162 | import java.util.Locale; |
164 | 163 | import java.util.Map; |
165 | 164 | import java.util.function.BiFunction; |
166 | | -import java.util.regex.Pattern; |
167 | 165 | import java.util.stream.Collectors; |
168 | 166 |
|
169 | | -import static java.util.Collections.emptyList; |
170 | 167 | import static java.util.Collections.unmodifiableList; |
171 | | -import static java.util.stream.Collectors.toList; |
172 | 168 | import static org.elasticsearch.xpack.esql.core.type.DataType.BOOLEAN; |
173 | 169 | import static org.elasticsearch.xpack.esql.core.type.DataType.CARTESIAN_POINT; |
174 | 170 | import static org.elasticsearch.xpack.esql.core.type.DataType.CARTESIAN_SHAPE; |
@@ -269,16 +265,6 @@ public Collection<FunctionDefinition> listFunctions() { |
269 | 265 | return defs.values(); |
270 | 266 | } |
271 | 267 |
|
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 | | - |
282 | 268 | private static FunctionDefinition[][] functions() { |
283 | 269 | return new FunctionDefinition[][] { |
284 | 270 | // grouping functions |
@@ -793,10 +779,6 @@ protected void buildDataTypesForStringLiteralConversion(FunctionDefinition[]... |
793 | 779 | } |
794 | 780 | } |
795 | 781 |
|
796 | | - protected FunctionDefinition cloneDefinition(String name, FunctionDefinition definition) { |
797 | | - return new FunctionDefinition(name, emptyList(), definition.clazz(), definition.builder()); |
798 | | - } |
799 | | - |
800 | 782 | protected interface FunctionBuilder { |
801 | 783 | Function build(Source source, List<Expression> children, Configuration cfg); |
802 | 784 | } |
|
0 commit comments