Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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"));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Fork(Source source, List<LogicalPlan> children, List<Attribute> 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;
Expand Down Expand Up @@ -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<String, DataType> outputTypes = fork.output().stream().collect(Collectors.toMap(Attribute::name, Attribute::dataType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'");
Expand Down