use of io.trino.spiller.GenericPartitioningSpillerFactory in project trino by trinodb.
the class TestHashJoinOperator method testInnerJoinWithFailingSpill.
@Test(dataProvider = "joinWithFailingSpillValues")
public void testInnerJoinWithFailingSpill(boolean probeHashEnabled, List<WhenSpill> whenSpill, WhenSpillFails whenSpillFails) {
DummySpillerFactory buildSpillerFactory = new DummySpillerFactory();
DummySpillerFactory joinSpillerFactory = new DummySpillerFactory();
PartitioningSpillerFactory partitioningSpillerFactory = new GenericPartitioningSpillerFactory(joinSpillerFactory);
String expectedMessage;
switch(whenSpillFails) {
case SPILL_BUILD:
buildSpillerFactory.failSpill();
expectedMessage = "Spill failed";
break;
case SPILL_JOIN:
joinSpillerFactory.failSpill();
expectedMessage = "Spill failed";
break;
case UNSPILL_BUILD:
buildSpillerFactory.failUnspill();
expectedMessage = "Unspill failed";
break;
case UNSPILL_JOIN:
joinSpillerFactory.failUnspill();
expectedMessage = "Unspill failed";
break;
default:
throw new IllegalArgumentException(format("Unsupported option: %s", whenSpillFails));
}
assertThatThrownBy(() -> innerJoinWithSpill(probeHashEnabled, whenSpill, buildSpillerFactory, partitioningSpillerFactory)).isInstanceOf(RuntimeException.class).hasMessage(expectedMessage);
}
Aggregations