Search in sources :

Example 1 with BatchMerger

use of org.apache.drill.exec.physical.impl.xsort.managed.PriorityQueueCopierWrapper.BatchMerger in project drill by axbaretto.

the class TestCopier method testEmptyInput.

@Test
public void testEmptyInput() throws Exception {
    BatchSchema schema = SortTestUtilities.nonNullSchema();
    List<BatchGroup> batches = new ArrayList<>();
    Sort popConfig = SortTestUtilities.makeCopierConfig(Ordering.ORDER_ASC, Ordering.NULLS_UNSPECIFIED);
    OperatorContext opContext = fixture.newOperatorContext(popConfig);
    PriorityQueueCopierWrapper copier = new PriorityQueueCopierWrapper(opContext);
    VectorContainer dest = new VectorContainer();
    try {
        // TODO: Create a vector allocator to pass as last parameter so
        // that the test uses the same vector allocator as the production
        // code. Only nuisance is that we don't have the required metadata
        // readily at hand here...
        @SuppressWarnings({ "resource", "unused" }) BatchMerger merger = copier.startMerge(schema, batches, dest, 10, null);
        fail();
    } catch (AssertionError e) {
    // Expected
    } finally {
        opContext.close();
    }
}
Also used : BatchSchema(org.apache.drill.exec.record.BatchSchema) BatchMerger(org.apache.drill.exec.physical.impl.xsort.managed.PriorityQueueCopierWrapper.BatchMerger) OperatorContext(org.apache.drill.exec.ops.OperatorContext) ArrayList(java.util.ArrayList) Sort(org.apache.drill.exec.physical.config.Sort) VectorContainer(org.apache.drill.exec.record.VectorContainer) OperatorTest(org.apache.drill.categories.OperatorTest) SubOperatorTest(org.apache.drill.test.SubOperatorTest) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 OperatorTest (org.apache.drill.categories.OperatorTest)1 OperatorContext (org.apache.drill.exec.ops.OperatorContext)1 Sort (org.apache.drill.exec.physical.config.Sort)1 BatchMerger (org.apache.drill.exec.physical.impl.xsort.managed.PriorityQueueCopierWrapper.BatchMerger)1 BatchSchema (org.apache.drill.exec.record.BatchSchema)1 VectorContainer (org.apache.drill.exec.record.VectorContainer)1 SubOperatorTest (org.apache.drill.test.SubOperatorTest)1 Test (org.junit.Test)1