use of com.facebook.presto.spiller.PartitioningSpillerFactory in project presto by prestodb.
the class TestHashJoinOperator method testInnerJoinWithFailingSpill.
@Test(dataProvider = "joinWithFailingSpillValues")
public void testInnerJoinWithFailingSpill(boolean probeHashEnabled, List<WhenSpill> whenSpill, WhenSpillFails whenSpillFails, boolean isDictionaryProcessingJoinEnabled) throws Throwable {
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));
}
try {
innerJoinWithSpill(probeHashEnabled, whenSpill, buildSpillerFactory, partitioningSpillerFactory);
fail("Exception not thrown");
} catch (RuntimeException exception) {
assertEquals(exception.getMessage(), expectedMessage);
}
}
Aggregations