@@ -961,14 +961,12 @@ public void testBasicSortCommand() {
961961 }
962962
963963 public void testSubquery () {
964- assertEquals (new Explain (EMPTY , PROCESSING_CMD_INPUT ), statement ("explain ( row a = 1 )" ));
965- }
966-
967- public void testSubqueryWithPipe () {
964+ assumeTrue ("Requires EXPLAIN capability" , EsqlCapabilities .Cap .EXPLAIN .isEnabled ());
968965 assertEquals (new Explain (EMPTY , PROCESSING_CMD_INPUT ), statement ("explain ( row a = 1 )" ));
969966 }
970967
971968 public void testBlockComments () {
969+ assumeTrue ("Requires EXPLAIN capability" , EsqlCapabilities .Cap .EXPLAIN .isEnabled ());
972970 String query = " explain ( from foo )" ;
973971 LogicalPlan expected = statement (query );
974972
@@ -984,6 +982,7 @@ public void testBlockComments() {
984982 }
985983
986984 public void testSingleLineComments () {
985+ assumeTrue ("Requires EXPLAIN capability" , EsqlCapabilities .Cap .EXPLAIN .isEnabled ());
987986 String query = " explain ( from foo ) " ;
988987 LogicalPlan expected = statement (query );
989988
@@ -1009,16 +1008,19 @@ public void testNewLines() {
10091008 }
10101009
10111010 public void testSuggestAvailableSourceCommandsOnParsingError () {
1012- for (Tuple <String , String > queryWithUnexpectedCmd : List .of (
1013- Tuple .tuple ("frm foo" , "frm" ),
1014- Tuple .tuple ("expln[from bar]" , "expln" ),
1015- Tuple .tuple ("not-a-thing logs" , "not-a-thing" ),
1016- Tuple .tuple ("high5 a" , "high5" ),
1017- Tuple .tuple ("a+b = c" , "a+b" ),
1018- Tuple .tuple ("a//hi" , "a" ),
1019- Tuple .tuple ("a/*hi*/" , "a" ),
1020- Tuple .tuple ("explain ( frm a )" , "frm" )
1021- )) {
1011+ var cases = new ArrayList <Tuple <String , String >>();
1012+ cases .add (Tuple .tuple ("frm foo" , "frm" ));
1013+ cases .add (Tuple .tuple ("expln[from bar]" , "expln" ));
1014+ cases .add (Tuple .tuple ("not-a-thing logs" , "not-a-thing" ));
1015+ cases .add (Tuple .tuple ("high5 a" , "high5" ));
1016+ cases .add (Tuple .tuple ("a+b = c" , "a+b" ));
1017+ cases .add (Tuple .tuple ("a//hi" , "a" ));
1018+ cases .add (Tuple .tuple ("a/*hi*/" , "a" ));
1019+ if (EsqlCapabilities .Cap .EXPLAIN .isEnabled ()) {
1020+ cases .add (Tuple .tuple ("explain ( frm a )" , "frm" ));
1021+ }
1022+
1023+ for (Tuple <String , String > queryWithUnexpectedCmd : cases ) {
10221024 expectThrows (
10231025 ParsingException .class ,
10241026 allOf (
@@ -1084,7 +1086,12 @@ public void testDeprecatedIsNullFunction() {
10841086 public void testMetadataFieldOnOtherSources () {
10851087 expectError ("row a = 1 metadata _index" , "line 1:20: extraneous input '_index' expecting <EOF>" );
10861088 expectError ("show info metadata _index" , "line 1:11: token recognition error at: 'm'" );
1087- expectError ("explain ( from foo ) metadata _index" , "line 1:22: mismatched input 'metadata' expecting {'|', ',', ')', 'metadata'}" );
1089+ if (EsqlCapabilities .Cap .EXPLAIN .isEnabled ()) {
1090+ expectError (
1091+ "explain ( from foo ) metadata _index" ,
1092+ "line 1:22: mismatched input 'metadata' expecting {'|', ',', ')', 'metadata'}"
1093+ );
1094+ }
10881095 }
10891096
10901097 public void testMetadataFieldMultipleDeclarations () {
0 commit comments