diff --git a/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ForkIT.java b/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ForkIT.java index 2140d679be745..984f4038e9ba8 100644 --- a/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ForkIT.java +++ b/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ForkIT.java @@ -1017,7 +1017,7 @@ public void testForkWithinFork() { ( FORK (WHERE true) (WHERE true) ) """; var e = expectThrows(VerificationException.class, () -> run(query)); - assertTrue(e.getMessage().contains("Only a single FORK command is allowed, but found multiple")); + assertTrue(e.getMessage().contains("Only a single FORK command is supported, but found multiple")); } public void testProfile() { @@ -1054,7 +1054,7 @@ public void testWithTooManySubqueries() { (WHERE true) (WHERE true) (WHERE true) (WHERE true) """; var e = expectThrows(ParsingException.class, () -> run(query)); - assertTrue(e.getMessage().contains("Fork requires less than 8 branches")); + assertTrue(e.getMessage().contains("Fork supports up to 8 branches")); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/LogicalPlanBuilder.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/LogicalPlanBuilder.java index 9e232bd8f02f9..cfb431ab0a293 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/LogicalPlanBuilder.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/LogicalPlanBuilder.java @@ -678,7 +678,7 @@ public PlanFactory visitForkCommand(EsqlBaseParser.ForkCommandContext ctx) { throw new ParsingException(source(ctx), "Fork requires at least " + Fork.MIN_BRANCHES + " branches"); } if (subQueries.size() > Fork.MAX_BRANCHES) { - throw new ParsingException(source(ctx), "Fork requires less than " + Fork.MAX_BRANCHES + " branches"); + throw new ParsingException(source(ctx), "Fork supports up to " + Fork.MAX_BRANCHES + " branches"); } return input -> { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Fork.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Fork.java index b9c19b0e38eb5..0c76116d37712 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Fork.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Fork.java @@ -46,7 +46,7 @@ public Fork(Source source, List children, List output) { throw new IllegalArgumentException("FORK requires more than " + MIN_BRANCHES + " branches, got: " + children.size()); } if (children.size() > MAX_BRANCHES) { - throw new IllegalArgumentException("FORK requires less than " + MAX_BRANCHES + " subqueries, got: " + children.size()); + throw new IllegalArgumentException("FORK supports up to " + MAX_BRANCHES + " branches, got: " + children.size()); } this.output = output; @@ -192,7 +192,7 @@ private static void checkFork(LogicalPlan plan, Failures failures) { return; } - failures.add(Failure.fail(otherFork, "Only a single FORK command is allowed, but found multiple")); + failures.add(Failure.fail(otherFork, "Only a single FORK command is supported, but found multiple")); }); Map outputTypes = fork.output().stream().collect(Collectors.toMap(Attribute::name, Attribute::dataType)); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java index 20cc9bbdbd4a9..e36a43cf8d67d 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java @@ -3391,14 +3391,14 @@ public void testForkError() { | FORK (EVAL a = 1) (EVAL a = 2) | FORK (EVAL b = 3) (EVAL b = 4) """)); - assertThat(e.getMessage(), containsString("Only a single FORK command is allowed, but found multiple")); + assertThat(e.getMessage(), containsString("Only a single FORK command is supported, but found multiple")); e = expectThrows(VerificationException.class, () -> analyze(""" FROM test | FORK (FORK (WHERE true) (WHERE true)) (WHERE true) """)); - assertThat(e.getMessage(), containsString("Only a single FORK command is allowed, but found multiple")); + assertThat(e.getMessage(), containsString("Only a single FORK command is supported, but found multiple")); } public void testValidFuse() { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java index 31e0074a7fde1..b7f4968cf725e 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/parser/StatementParserTests.java @@ -3645,7 +3645,7 @@ public void testInvalidFork() { | FORK (where true) (where true) (where true) (where true) (where true) (where true) (where true) (where true) (where true) - """, "Fork requires less than 8 branches"); + """, "Fork supports up to 8 branches"); expectError("FROM foo* | FORK ( x+1 ) ( WHERE y>2 )", "line 1:20: mismatched input 'x+1'"); expectError("FROM foo* | FORK ( LIMIT 10 ) ( y+2 )", "line 1:33: mismatched input 'y+2'");