File tree Expand file tree Collapse file tree 5 files changed +11
-6
lines changed
server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq
testFixtures/src/main/resources
main/java/org/elasticsearch/xpack/esql
test/java/org/elasticsearch/xpack/esql/parser Expand file tree Collapse file tree 5 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 4848import static org .elasticsearch .xpack .esql .CsvTestsDataLoader .CSV_DATASET_MAP ;
4949import static org .elasticsearch .xpack .esql .CsvTestsDataLoader .ENRICH_SOURCE_INDICES ;
5050import static org .elasticsearch .xpack .esql .EsqlTestUtils .classpathResources ;
51+ import static org .elasticsearch .xpack .esql .action .EsqlCapabilities .Cap .ENABLE_FORK_FOR_REMOTE_INDICES_V2 ;
5152import static org .elasticsearch .xpack .esql .action .EsqlCapabilities .Cap .ENABLE_LOOKUP_JOIN_ON_REMOTE ;
5253import static org .elasticsearch .xpack .esql .action .EsqlCapabilities .Cap .FORK_V9 ;
5354import static org .elasticsearch .xpack .esql .action .EsqlCapabilities .Cap .INLINE_STATS ;
@@ -167,7 +168,12 @@ protected void shouldSkipTest(String testName) throws IOException {
167168 // Tests that do SORT before LOOKUP JOIN - not supported in CCS
168169 assumeFalse ("LOOKUP JOIN after SORT not yet supported in CCS" , testName .contains ("OnTheCoordinator" ));
169170
170- assumeFalse ("FORK not yet supported with CCS" , testCase .requiredCapabilities .contains (FORK_V9 .capabilityName ()));
171+ if (testCase .requiredCapabilities .contains (FORK_V9 .capabilityName ())) {
172+ assumeTrue (
173+ "FORK not yet supported with CCS" ,
174+ hasCapabilities (adminClient (), List .of (ENABLE_FORK_FOR_REMOTE_INDICES_V2 .capabilityName ()))
175+ );
176+ }
171177 }
172178
173179 private TestFeatureService remoteFeaturesService () throws IOException {
Original file line number Diff line number Diff line change @@ -319,10 +319,9 @@ null | null | 4 | 172.21.3.15
319319;
320320
321321subqueryWithCountStarAndDateTrunc
322- required_capability: fork_v9
323322required_capability: subquery_in_from_command
324323
325- FROM employees, (FROM sample_data
324+ FROM employees, (FROM sample_data metadata _index
326325 | STATS cnt = count(*) by ts=date_trunc(1 hour, @timestamp)
327326 | SORT cnt DESC
328327 )
Original file line number Diff line number Diff line change @@ -1469,7 +1469,7 @@ public enum Cap {
14691469 /**
14701470 * FORK with remote indices
14711471 */
1472- ENABLE_FORK_FOR_REMOTE_INDICES (Build .current ().isSnapshot ()),
1472+ ENABLE_FORK_FOR_REMOTE_INDICES_V2 (Build .current ().isSnapshot ()),
14731473
14741474 /**
14751475 * Support for the Present function
Original file line number Diff line number Diff line change @@ -972,7 +972,7 @@ public PlanFactory visitForkCommand(EsqlBaseParser.ForkCommandContext ctx) {
972972 }
973973
974974 return input -> {
975- if (EsqlCapabilities .Cap .ENABLE_FORK_FOR_REMOTE_INDICES .isEnabled () == false ) {
975+ if (EsqlCapabilities .Cap .ENABLE_FORK_FOR_REMOTE_INDICES_V2 .isEnabled () == false ) {
976976 checkForRemoteClusters (input , source (ctx ), "FORK" );
977977 }
978978 List <LogicalPlan > subPlans = subQueries .stream ().map (planFactory -> planFactory .apply (input )).toList ();
Original file line number Diff line number Diff line change @@ -3580,7 +3580,7 @@ public void testInvalidFork() {
35803580 expectError ("FROM foo* | FORK (where true) ()" , "line 1:32: mismatched input ')'" );
35813581 expectError ("FROM foo* | FORK () (where true)" , "line 1:19: mismatched input ')'" );
35823582
3583- if (EsqlCapabilities .Cap .ENABLE_FORK_FOR_REMOTE_INDICES .isEnabled () == false ) {
3583+ if (EsqlCapabilities .Cap .ENABLE_FORK_FOR_REMOTE_INDICES_V2 .isEnabled () == false ) {
35843584 var fromPatterns = randomIndexPatterns (CROSS_CLUSTER );
35853585 expectError (
35863586 "FROM " + fromPatterns + " | FORK (EVAL a = 1) (EVAL a = 2)" ,
You can’t perform that action at this time.
0 commit comments