Skip to content

Commit c54308e

Browse files
committed
Address review comments
1 parent c4cc4df commit c54308e

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/FieldAttribute.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,4 @@ protected String label() {
243243
public EsField field() {
244244
return field;
245245
}
246-
247-
/**
248-
* If this field is unsupported this contains the underlying ES types. If there
249-
* is a type conflict this will have many elements, some or all of which may
250-
* be actually supported types.
251-
*/
252-
@Nullable
253-
public List<String> originalTypes() {
254-
return null;
255-
}
256246
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ protected boolean innerEquals(Object o) {
174174
return super.innerEquals(other) && hasCustomMessage == other.hasCustomMessage && Objects.equals(message, other.message);
175175
}
176176

177-
@Override
177+
/**
178+
* This contains all the underlying ES types.
179+
* On a type conflict this will have many elements, some or all of which may be actually supported types.
180+
*/
178181
public List<String> originalTypes() {
179182
return field().getOriginalTypes();
180183
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/TransportEsqlQueryAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
import org.elasticsearch.xpack.esql.action.EsqlQueryResponse;
4444
import org.elasticsearch.xpack.esql.action.EsqlQueryTask;
4545
import org.elasticsearch.xpack.esql.core.async.AsyncTaskManagementService;
46-
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
4746
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
4847
import org.elasticsearch.xpack.esql.enrich.AbstractLookupService;
4948
import org.elasticsearch.xpack.esql.enrich.EnrichLookupService;
5049
import org.elasticsearch.xpack.esql.enrich.EnrichPolicyResolver;
5150
import org.elasticsearch.xpack.esql.enrich.LookupFromIndexService;
5251
import org.elasticsearch.xpack.esql.execution.PlanExecutor;
52+
import org.elasticsearch.xpack.esql.expression.function.UnsupportedAttribute;
5353
import org.elasticsearch.xpack.esql.inference.InferenceRunner;
5454
import org.elasticsearch.xpack.esql.session.Configuration;
5555
import org.elasticsearch.xpack.esql.session.EsqlSession.PlanRunner;
@@ -322,9 +322,9 @@ private EsqlExecutionInfo createEsqlExecutionInfo(EsqlQueryRequest request) {
322322
private EsqlQueryResponse toResponse(Task task, EsqlQueryRequest request, Configuration configuration, Result result) {
323323
List<ColumnInfoImpl> columns = result.schema().stream().map(c -> {
324324
List<String> originalTypes;
325-
if (c instanceof FieldAttribute fa && (originalTypes = fa.originalTypes()) != null) {
325+
if (c instanceof UnsupportedAttribute ua) {
326326
// Sort the original types so they are easier to test against and prettier.
327-
originalTypes = new ArrayList<>(originalTypes);
327+
originalTypes = new ArrayList<>(ua.originalTypes());
328328
Collections.sort(originalTypes);
329329
} else {
330330
originalTypes = null;

0 commit comments

Comments
 (0)