File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
java/org/elasticsearch/xpack/esql/parser
test/java/org/elasticsearch/xpack/esql/parser Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ lexer grammar From;
1111//
1212FROM : ' from' -> pushMode(FROM_MODE );
1313
14- DEV_TIME_SERIES : {this.isDevVersion ()} ? ' ts' -> pushMode(FROM_MODE );
14+ DEV_TIME_SERIES : {this.hasMetricsCommand ()} ? ' ts' -> pushMode(FROM_MODE );
1515
1616mode FROM_MODE ;
1717FROM_PIPE : PIPE -> type(PIPE ), popMode;
Original file line number Diff line number Diff line change 88package org .elasticsearch .xpack .esql .parser ;
99
1010import org .elasticsearch .Build ;
11+ import org .elasticsearch .xpack .esql .action .EsqlCapabilities ;
1112
1213class EsqlConfig {
1314
1415 // versioning information
1516 boolean devVersion = Build .current ().isSnapshot ();
1617
18+ boolean metricsCommand = EsqlCapabilities .Cap .METRICS_COMMAND .isEnabled ();
19+
1720 public boolean isDevVersion () {
1821 return devVersion ;
1922 }
@@ -25,4 +28,12 @@ boolean isReleaseVersion() {
2528 public void setDevVersion (boolean dev ) {
2629 this .devVersion = dev ;
2730 }
31+
32+ public boolean hasMetricsCommand () {
33+ return metricsCommand ;
34+ }
35+
36+ public void setMetricsCommand (boolean metricsCommand ) {
37+ this .metricsCommand = metricsCommand ;
38+ }
2839}
Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ boolean isDevVersion() {
2828 return config == null || config .isDevVersion ();
2929 }
3030
31+ boolean hasMetricsCommand () {
32+ return config == null || config .hasMetricsCommand ();
33+ }
34+
3135 void setEsqlConfig (EsqlConfig config ) {
3236 this .config = config ;
3337 }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ private EsqlParser parser() {
4545
4646 // manually disable dev mode (make it production)
4747 config .setDevVersion (false );
48+ config .setMetricsCommand (false );
4849 return parser ;
4950 }
5051}
You can’t perform that action at this time.
0 commit comments