Skip to content

Commit a45fd89

Browse files
authored
Allow LimitOperator in Driver assertion (#130235) (#130297)
The LimitOperator can be finished early because the Limiter may be shared across operators. This PR relaxes the assertion to allow for this. Closes #130228 Closes #130219 (cherry picked from commit ddef899)
1 parent 321fdae commit a45fd89

File tree

1 file changed

+2
-0
lines changed
  • x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator

1 file changed

+2
-0
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/Driver.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ private IsBlockedResult runSingleLoopIteration() {
292292

293293
if (op.isFinished() == false && nextOp.needsInput()) {
294294
driverContext.checkForEarlyTermination();
295+
assert nextOp.isFinished() == false || nextOp instanceof ExchangeSinkOperator || nextOp instanceof LimitOperator
296+
: "next operator should not be finished yet: " + nextOp;
295297
Page page = op.getOutput();
296298
if (page == null) {
297299
// No result, just move to the next iteration

0 commit comments

Comments
 (0)