Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,4 @@ public String nodeString() {
}

protected abstract String label();

/**
* If this field is unsupported this contains the underlying ES types. If there
* is a type conflict this will have many elements, some or all of which may
* be actually supported types.
*/
@Nullable
public List<String> originalTypes() {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ protected boolean innerEquals(Object o) {
return super.innerEquals(other) && hasCustomMessage == other.hasCustomMessage && Objects.equals(message, other.message);
}

@Override
/**
* This contains all the underlying ES types.
* On a type conflict this will have many elements, some or all of which may be actually supported types.
*/
public List<String> originalTypes() {
return field().getOriginalTypes();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.elasticsearch.xpack.esql.enrich.EnrichPolicyResolver;
import org.elasticsearch.xpack.esql.enrich.LookupFromIndexService;
import org.elasticsearch.xpack.esql.execution.PlanExecutor;
import org.elasticsearch.xpack.esql.expression.function.UnsupportedAttribute;
import org.elasticsearch.xpack.esql.inference.InferenceRunner;
import org.elasticsearch.xpack.esql.session.Configuration;
import org.elasticsearch.xpack.esql.session.EsqlSession.PlanRunner;
Expand Down Expand Up @@ -324,12 +325,12 @@ private EsqlExecutionInfo createEsqlExecutionInfo(EsqlQueryRequest request) {
private EsqlQueryResponse toResponse(Task task, EsqlQueryRequest request, Configuration configuration, Result result) {
List<ColumnInfoImpl> columns = result.schema().stream().map(c -> {
List<String> originalTypes;
if (c.originalTypes() == null) {
originalTypes = null;
} else {
if (c instanceof UnsupportedAttribute ua) {
// Sort the original types so they are easier to test against and prettier.
originalTypes = new ArrayList<>(c.originalTypes());
originalTypes = new ArrayList<>(ua.originalTypes());
Collections.sort(originalTypes);
} else {
originalTypes = null;
}
return new ColumnInfoImpl(c.name(), c.dataType().outputType(), originalTypes);
}).toList();
Expand Down