Skip to content

Commit af7a60b

Browse files
committed
undo AbstractConvertFunction -> EsqlScalarFunction change in TypeConverter and remove limit from IT test
1 parent 583a321 commit af7a60b

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

x-pack/plugin/downsample/src/internalClusterTest/java/org/elasticsearch/xpack/downsample/DownsampleIT.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.io.IOException;
3030
import java.time.Instant;
3131
import java.util.List;
32-
import java.util.Locale;
3332
import java.util.concurrent.TimeUnit;
3433
import java.util.function.Supplier;
3534

@@ -259,10 +258,6 @@ public void testAggMetricInEsqlTSAfterDownsampling() throws Exception {
259258
}
260259

261260
private EsqlQueryResponse esqlCommand(String command) throws IOException {
262-
if (command.toLowerCase(Locale.ROOT).contains("limit") == false) {
263-
// add a (high) limit to avoid warnings on default limit
264-
command += " | limit 10000000";
265-
}
266261
return client().execute(EsqlQueryAction.INSTANCE, new EsqlQueryRequest().query(command)).actionGet(30, TimeUnit.SECONDS);
267262
}
268263
}

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.EsqlScalarFunction;
69+
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
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, (EsqlScalarFunction) conversion);
205+
: new TypeConvertingBlockLoader(blockLoader, (AbstractConvertFunction) 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, EsqlScalarFunction convertFunction) {
545+
protected TypeConvertingBlockLoader(BlockLoader delegate, AbstractConvertFunction convertFunction) {
546546
this.delegate = delegate;
547-
this.typeConverter = TypeConverter.fromScalarFunction(convertFunction);
547+
this.typeConverter = TypeConverter.fromConvertFunction(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.EsqlScalarFunction;
20+
import org.elasticsearch.xpack.esql.expression.function.scalar.convert.AbstractConvertFunction;
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 fromScalarFunction(EsqlScalarFunction convertFunction) {
31+
public static TypeConverter fromConvertFunction(AbstractConvertFunction 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.fromScalarFunction(conversion).convert(success.block);
335+
case BlockResultSuccess success -> TypeConverter.fromConvertFunction(conversion).convert(success.block);
336336
};
337337
}
338338

0 commit comments

Comments
 (0)