Search in sources :

Example 1 with PartitioningSpillerFactory

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);
    }
}
Also used : GenericPartitioningSpillerFactory(com.facebook.presto.spiller.GenericPartitioningSpillerFactory) PartitioningSpillerFactory(com.facebook.presto.spiller.PartitioningSpillerFactory) GenericPartitioningSpillerFactory(com.facebook.presto.spiller.GenericPartitioningSpillerFactory) Test(org.testng.annotations.Test)

Aggregations

GenericPartitioningSpillerFactory (com.facebook.presto.spiller.GenericPartitioningSpillerFactory)1 PartitioningSpillerFactory (com.facebook.presto.spiller.PartitioningSpillerFactory)1 Test (org.testng.annotations.Test)1