Skip to content

Commit

Permalink
ESQL: Remove DataTypeRegistry (elastic#111464)
Browse files Browse the repository at this point in the history
This removes the `DataTypeRegistry` interface, moving the only use ESQL
has into a test class called `LoadMapping`. Previously, we were using
this via a production class `Types` and `TypesTests`. We don't need
either of those two, which are removed.

ESQL has an implementation of `DataTypeRegistry` and this removes the
`implements DataTypeRegistry` part and removes all unused methods.

This also removes `DefaultDataTypeRegistry` which is unused.
  • Loading branch information
nik9000 authored Jul 30, 2024
1 parent aeda46c commit d8df7e4
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 424 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.elasticsearch.xpack.esql.core.type.DataType;
import org.elasticsearch.xpack.esql.core.type.DateUtils;
import org.elasticsearch.xpack.esql.core.type.EsField;
import org.elasticsearch.xpack.esql.core.type.TypesTests;
import org.elasticsearch.xpack.esql.core.util.StringUtils;
import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.Equals;
import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.GreaterThan;
Expand All @@ -57,7 +56,6 @@
import org.elasticsearch.xpack.esql.session.EsqlConfiguration;
import org.elasticsearch.xpack.esql.stats.Metrics;
import org.elasticsearch.xpack.esql.stats.SearchStats;
import org.elasticsearch.xpack.esql.type.EsqlDataTypeRegistry;
import org.junit.Assert;

import java.io.BufferedReader;
Expand Down Expand Up @@ -280,7 +278,7 @@ public static <T> T as(Object node, Class<T> type) {
}

public static Map<String, EsField> loadMapping(String name) {
return TypesTests.loadMapping(EsqlDataTypeRegistry.INSTANCE, name, true);
return LoadMapping.loadMapping(name);
}

public static String loadUtf8TextFile(String name) {
Expand Down
Loading

0 comments on commit d8df7e4

Please sign in to comment.