Skip to content

Commit 3c39e90

Browse files
fix failing UT
1 parent 5a2b2fd commit 3c39e90

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/LookupFromIndexIT.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@
6464
import org.elasticsearch.xpack.esql.enrich.LookupFromIndexOperator;
6565
import org.elasticsearch.xpack.esql.enrich.MatchConfig;
6666
import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.GreaterThan;
67-
import org.elasticsearch.xpack.esql.plan.physical.EsQueryExec;
68-
import org.elasticsearch.xpack.esql.plan.physical.FilterExec;
67+
import org.elasticsearch.xpack.esql.plan.logical.EsRelation;
68+
import org.elasticsearch.xpack.esql.plan.logical.Filter;
69+
import org.elasticsearch.xpack.esql.plan.physical.FragmentExec;
6970
import org.elasticsearch.xpack.esql.plan.physical.PhysicalPlan;
7071
import org.elasticsearch.xpack.esql.planner.EsPhysicalOperationProviders;
7172
import org.elasticsearch.xpack.esql.planner.PhysicalSettings;
@@ -240,8 +241,9 @@ private PhysicalPlan buildGreaterThanFilter(long value) {
240241
new EsField("l", DataType.LONG, Collections.emptyMap(), true, EsField.TimeSeriesFieldType.NONE)
241242
);
242243
Expression greaterThan = new GreaterThan(Source.EMPTY, filterAttribute, new Literal(Source.EMPTY, value, DataType.LONG));
243-
EsQueryExec queryExec = new EsQueryExec(Source.EMPTY, "test", IndexMode.LOOKUP, Map.of(), List.of(), null);
244-
return new FilterExec(Source.EMPTY, queryExec, greaterThan);
244+
EsRelation esRelation = new EsRelation(Source.EMPTY, "test", IndexMode.LOOKUP, Map.of(), List.of());
245+
Filter filter = new Filter(Source.EMPTY, esRelation, greaterThan);
246+
return new FragmentExec(filter);
245247
}
246248

247249
private void runLookup(List<DataType> keyTypes, PopulateIndices populateIndices, PhysicalPlan filters) throws IOException {
@@ -274,8 +276,9 @@ private void runLookup(List<DataType> keyTypes, PopulateIndices populateIndices,
274276
client().admin().cluster().prepareHealth(TEST_REQUEST_TIMEOUT).setWaitForGreenStatus().get();
275277

276278
Predicate<Integer> filterPredicate = l -> true;
277-
if (filters instanceof FilterExec filterExec) {
278-
if (filterExec.condition() instanceof GreaterThan gt
279+
if (filters instanceof FragmentExec fragmentExec) {
280+
if (fragmentExec.fragment() instanceof Filter filter
281+
&& filter.condition() instanceof GreaterThan gt
279282
&& gt.left() instanceof FieldAttribute fa
280283
&& fa.name().equals("l")
281284
&& gt.right() instanceof Literal lit) {

0 commit comments

Comments
 (0)