|
8 | 8 | package org.elasticsearch.xpack.esql.approximate; |
9 | 9 |
|
10 | 10 | import org.apache.lucene.util.SetOnce; |
| 11 | +import org.elasticsearch.TransportVersion; |
11 | 12 | import org.elasticsearch.action.ActionListener; |
12 | 13 | import org.elasticsearch.common.breaker.CircuitBreaker; |
13 | 14 | import org.elasticsearch.common.unit.ByteSizeValue; |
|
19 | 20 | import org.elasticsearch.compute.test.MockBlockFactory; |
20 | 21 | import org.elasticsearch.test.ESTestCase; |
21 | 22 | import org.elasticsearch.xpack.esql.VerificationException; |
22 | | -import org.elasticsearch.xpack.esql.analysis.Analyzer; |
23 | 23 | import org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils; |
24 | 24 | import org.elasticsearch.xpack.esql.core.expression.FoldContext; |
25 | 25 | import org.elasticsearch.xpack.esql.core.expression.Literal; |
|
55 | 55 | public class ApproximateTests extends ESTestCase { |
56 | 56 |
|
57 | 57 | private static final EsqlParser parser = new EsqlParser(); |
58 | | - private static final Analyzer analyzer = AnalyzerTestUtils.defaultAnalyzer(); |
59 | 58 | private static final LogicalPlanPreOptimizer preOptimizer = new LogicalPlanPreOptimizer( |
60 | | - new LogicalPreOptimizerContext(FoldContext.small(), mock(InferenceService.class)) |
| 59 | + new LogicalPreOptimizerContext(FoldContext.small(), mock(InferenceService.class), TransportVersion.current()) |
61 | 60 | ); |
62 | 61 | private static final CircuitBreaker breaker = newLimitedBreaker(ByteSizeValue.ofGb(1)); |
63 | 62 | private static final BigArrays bigArrays = new MockBigArrays(PageCacheRecycler.NON_RECYCLING_INSTANCE, ByteSizeValue.ofGb(1)); |
@@ -367,7 +366,7 @@ private LogicalPlan getLogicalPlan(String query) throws Exception { |
367 | 366 | SetOnce<LogicalPlan> resultHolder = new SetOnce<>(); |
368 | 367 | SetOnce<Exception> exceptionHolder = new SetOnce<>(); |
369 | 368 | LogicalPlan plan = parser.createStatement(query, new QueryParams()); |
370 | | - plan = analyzer.analyze(plan); |
| 369 | + plan = AnalyzerTestUtils.defaultAnalyzer().analyze(plan); |
371 | 370 | plan.setAnalyzed(); |
372 | 371 | preOptimizer.preOptimize(plan, ActionListener.wrap(resultHolder::set, exceptionHolder::set)); |
373 | 372 | if (exceptionHolder.get() != null) { |
|
0 commit comments