Skip to content

Commit 38682b7

Browse files
committed
Revert undo AbstractConvertFunction -> EsqlScalarFunction
This reverts (parts of) commit af7a60b.
1 parent 6022f17 commit 38682b7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
import org.elasticsearch.xpack.esql.core.type.KeywordEsField;
6767
import org.elasticsearch.xpack.esql.core.type.MultiTypeEsField;
6868
import org.elasticsearch.xpack.esql.core.type.PotentiallyUnmappedKeywordEsField;
69-
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
69+
import org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction;
7070
import org.elasticsearch.xpack.esql.plan.physical.AggregateExec;
7171
import org.elasticsearch.xpack.esql.plan.physical.EsQueryExec;
7272
import org.elasticsearch.xpack.esql.plan.physical.EsQueryExec.Sort;
@@ -202,7 +202,7 @@ private BlockLoader getBlockLoaderFor(int shardId, Attribute attr, MappedFieldTy
202202
Expression conversion = unionTypes.getConversionExpressionForIndex(indexName);
203203
return conversion == null
204204
? BlockLoader.CONSTANT_NULLS
205-
: new TypeConvertingBlockLoader(blockLoader, (AbstractConvertFunction) conversion);
205+
: new TypeConvertingBlockLoader(blockLoader, (EsqlScalarFunction) conversion);
206206
}
207207
return blockLoader;
208208
}
@@ -542,9 +542,9 @@ private static class TypeConvertingBlockLoader implements BlockLoader {
542542
private final BlockLoader delegate;
543543
private final TypeConverter typeConverter;
544544

545-
protected TypeConvertingBlockLoader(BlockLoader delegate, AbstractConvertFunction convertFunction) {
545+
protected TypeConvertingBlockLoader(BlockLoader delegate, EsqlScalarFunction convertFunction) {
546546
this.delegate = delegate;
547-
this.typeConverter = TypeConverter.fromConvertFunction(convertFunction);
547+
this.typeConverter = TypeConverter.fromScalarFunction(convertFunction);
548548
}
549549

550550
@Override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.elasticsearch.xpack.esql.core.expression.Expression;
1818
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
1919
import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper;
20-
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
20+
import org.elasticsearch.xpack.esql.expression.function.scalar.EsqlScalarFunction;
2121

2222
class TypeConverter {
2323
private final String evaluatorName;
@@ -28,7 +28,7 @@ private TypeConverter(String evaluatorName, ExpressionEvaluator convertEvaluator
2828
this.convertEvaluator = convertEvaluator;
2929
}
3030

31-
public static TypeConverter fromConvertFunction(AbstractConvertFunction convertFunction) {
31+
public static TypeConverter fromScalarFunction(EsqlScalarFunction convertFunction) {
3232
DriverContext driverContext1 = new DriverContext(
3333
BigArrays.NON_RECYCLING_INSTANCE,
3434
new org.elasticsearch.compute.data.BlockFactory(

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/planner/TestPhysicalOperationProviders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ private Block getBlockForMultiType(DocBlock indexDoc, MultiTypeEsField multiType
332332
}
333333
return switch (extractBlockForSingleDoc(indexDoc, ((FieldAttribute) conversion.field()).fieldName().string(), blockCopier)) {
334334
case BlockResultMissing unused -> getNullsBlock(indexDoc);
335-
case BlockResultSuccess success -> TypeConverter.fromConvertFunction(conversion).convert(success.block);
335+
case BlockResultSuccess success -> TypeConverter.fromScalarFunction(conversion).convert(success.block);
336336
};
337337
}
338338

0 commit comments

Comments
 (0)