99
1010package org .elasticsearch .benchmark ._nightly .esql ;
1111
12+ import org .elasticsearch .TransportVersion ;
1213import org .elasticsearch .common .logging .LogConfigurator ;
1314import org .elasticsearch .common .settings .Settings ;
1415import org .elasticsearch .index .IndexMode ;
1516import org .elasticsearch .license .XPackLicenseState ;
16- import org .elasticsearch .xpack .esql .analysis .Analyzer ;
17- import org .elasticsearch .xpack .esql .analysis .AnalyzerContext ;
18- import org .elasticsearch .xpack .esql .analysis .EnrichResolution ;
19- import org .elasticsearch .xpack .esql .analysis .Verifier ;
17+ import org .elasticsearch .xpack .esql .analysis .*;
2018import org .elasticsearch .xpack .esql .core .expression .FoldContext ;
2119import org .elasticsearch .xpack .esql .core .type .EsField ;
2220import org .elasticsearch .xpack .esql .core .util .DateUtils ;
2927import org .elasticsearch .xpack .esql .parser .EsqlParser ;
3028import org .elasticsearch .xpack .esql .parser .QueryParams ;
3129import org .elasticsearch .xpack .esql .plan .logical .LogicalPlan ;
32- import org .elasticsearch .xpack .esql .plugin .EsqlPlugin ;
3330import org .elasticsearch .xpack .esql .plugin .QueryPragmas ;
3431import org .elasticsearch .xpack .esql .session .Configuration ;
3532import org .elasticsearch .xpack .esql .telemetry .Metrics ;
@@ -80,15 +77,15 @@ public void setup() {
8077 null ,
8178 null ,
8279 new QueryPragmas (Settings .EMPTY ),
83- EsqlPlugin .QUERY_RESULT_TRUNCATION_MAX_SIZE .getDefault (Settings .EMPTY ),
84- EsqlPlugin .QUERY_RESULT_TRUNCATION_DEFAULT_SIZE .getDefault (Settings .EMPTY ),
80+ AnalyzerSettings .QUERY_RESULT_TRUNCATION_MAX_SIZE .getDefault (Settings .EMPTY ),
81+ AnalyzerSettings .QUERY_RESULT_TRUNCATION_DEFAULT_SIZE .getDefault (Settings .EMPTY ),
8582 "" ,
8683 false ,
8784 Map .of (),
8885 System .nanoTime (),
8986 false ,
90- EsqlPlugin .QUERY_TIMESERIES_RESULT_TRUNCATION_DEFAULT_SIZE .getDefault (Settings .EMPTY ),
91- EsqlPlugin .QUERY_TIMESERIES_RESULT_TRUNCATION_DEFAULT_SIZE .get (Settings .EMPTY )
87+ AnalyzerSettings .QUERY_TIMESERIES_RESULT_TRUNCATION_DEFAULT_SIZE .getDefault (Settings .EMPTY ),
88+ AnalyzerSettings .QUERY_TIMESERIES_RESULT_TRUNCATION_DEFAULT_SIZE .get (Settings .EMPTY )
9289 );
9390
9491 var fields = 10_000 ;
@@ -102,6 +99,9 @@ public void setup() {
10299
103100 var functionRegistry = new EsqlFunctionRegistry ();
104101
102+ // Assume all nodes are on the current version for the benchmark.
103+ TransportVersion minimumVersion = TransportVersion .current ();
104+
105105 telemetry = new PlanTelemetry (functionRegistry );
106106 defaultParser = new EsqlParser ();
107107 manyFieldsAnalyzer = new Analyzer (
@@ -111,11 +111,12 @@ public void setup() {
111111 IndexResolution .valid (esIndex ),
112112 Map .of (),
113113 new EnrichResolution (),
114- InferenceResolution .EMPTY
114+ InferenceResolution .EMPTY ,
115+ minimumVersion
115116 ),
116117 new Verifier (new Metrics (functionRegistry ), new XPackLicenseState (() -> 0L ))
117118 );
118- defaultOptimizer = new LogicalPlanOptimizer (new LogicalOptimizerContext (config , FoldContext .small ()));
119+ defaultOptimizer = new LogicalPlanOptimizer (new LogicalOptimizerContext (config , FoldContext .small (), minimumVersion ));
119120 }
120121
121122 private LogicalPlan plan (EsqlParser parser , Analyzer analyzer , LogicalPlanOptimizer optimizer , String query ) {
0 commit comments