Skip to content

Commit

Permalink
Improve GroupByHashYieldAssertion
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-stec authored and sopel39 committed May 27, 2022
1 parent aa26c96 commit 1cf9bc6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ public static GroupByHashYieldResult finishOperatorWithYieldingGroupByHash(List<
// free the pool for the next iteration
memoryPool.free(anotherTaskId, "test", reservedMemoryInBytes);
// this required in case input is blocked
operator.getOutput();
output = operator.getOutput();
if (output != null) {
result.add(output);
}
continue;
}

Expand All @@ -140,7 +143,7 @@ public static GroupByHashYieldResult finishOperatorWithYieldingGroupByHash(List<
assertTrue(operator.getOperatorContext().isWaitingForMemory().isDone());

// assert the hash capacity is not changed; otherwise, we should have yielded
assertTrue(oldCapacity == getHashCapacity.apply(operator));
assertEquals((int) getHashCapacity.apply(operator), oldCapacity);

// We are not going to rehash; therefore, assert the memory increase only comes from the aggregator
assertLessThan(actualIncreasedMemory, additionalMemoryInBytes);
Expand Down

0 comments on commit 1cf9bc6

Please sign in to comment.