|
64 | 64 | import org.elasticsearch.xpack.esql.enrich.LookupFromIndexOperator; |
65 | 65 | import org.elasticsearch.xpack.esql.enrich.MatchConfig; |
66 | 66 | 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; |
69 | 70 | import org.elasticsearch.xpack.esql.plan.physical.PhysicalPlan; |
70 | 71 | import org.elasticsearch.xpack.esql.planner.EsPhysicalOperationProviders; |
71 | 72 | import org.elasticsearch.xpack.esql.planner.PhysicalSettings; |
@@ -240,8 +241,9 @@ private PhysicalPlan buildGreaterThanFilter(long value) { |
240 | 241 | new EsField("l", DataType.LONG, Collections.emptyMap(), true, EsField.TimeSeriesFieldType.NONE) |
241 | 242 | ); |
242 | 243 | 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); |
245 | 247 | } |
246 | 248 |
|
247 | 249 | private void runLookup(List<DataType> keyTypes, PopulateIndices populateIndices, PhysicalPlan filters) throws IOException { |
@@ -274,8 +276,9 @@ private void runLookup(List<DataType> keyTypes, PopulateIndices populateIndices, |
274 | 276 | client().admin().cluster().prepareHealth(TEST_REQUEST_TIMEOUT).setWaitForGreenStatus().get(); |
275 | 277 |
|
276 | 278 | 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 |
279 | 282 | && gt.left() instanceof FieldAttribute fa |
280 | 283 | && fa.name().equals("l") |
281 | 284 | && gt.right() instanceof Literal lit) { |
|
0 commit comments