Skip to content

Commit 9141739

Browse files
committed
fix EsqlNodeSubclassTests
1 parent 401c50d commit 9141739

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/Fork.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public class Fork extends UnaryPlan implements SurrogateLogicalPlan {
2929

3030
public Fork(Source source, LogicalPlan child, List<LogicalPlan> subPlans) {
3131
super(source, child);
32+
if (subPlans.size() < 2) {
33+
throw new IllegalArgumentException("requires more than two subqueries, got:" + subPlans.size());
34+
}
3235
this.subPlans = subPlans;
3336
}
3437

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/tree/EsqlNodeSubclassTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public static List<Object[]> nodeSubclasses() throws IOException {
146146
.toList();
147147
}
148148

149-
private static final List<Class<?>> CLASSES_WITH_MIN_TWO_CHILDREN = List.of(Concat.class, CIDRMatch.class);
149+
private static final List<Class<?>> CLASSES_WITH_MIN_TWO_CHILDREN = List.of(Concat.class, CIDRMatch.class, Fork.class, Merge.class);
150150

151151
// List of classes that are "unresolved" NamedExpression subclasses, therefore not suitable for use with logical/physical plan nodes.
152152
private static final List<Class<?>> UNRESOLVED_CLASSES = List.of(

0 commit comments

Comments
 (0)