Search in sources :

Example 1 with MockScanBatchCreator

use of org.apache.drill.exec.store.mock.MockScanBatchCreator in project drill by apache.

the class ExpressionInterpreterTest method createMockScanBatch.

@SuppressWarnings("resource")
private ScanBatch createMockScanBatch(Drillbit bit, MockSubScanPOP scanPOP, BitControl.PlanFragment planFragment) {
    final List<RecordBatch> children = Lists.newArrayList();
    final MockScanBatchCreator creator = new MockScanBatchCreator();
    try {
        final FragmentContext context = new FragmentContext(bit.getContext(), planFragment, null, bit.getContext().getFunctionImplementationRegistry());
        return creator.getBatch(context, scanPOP, children);
    } catch (Exception ex) {
        throw new DrillRuntimeException("Error when setup fragment context" + ex);
    }
}
Also used : FragmentContext(org.apache.drill.exec.ops.FragmentContext) RecordBatch(org.apache.drill.exec.record.RecordBatch) DrillRuntimeException(org.apache.drill.common.exceptions.DrillRuntimeException) MockScanBatchCreator(org.apache.drill.exec.store.mock.MockScanBatchCreator) DrillRuntimeException(org.apache.drill.common.exceptions.DrillRuntimeException)

Aggregations

DrillRuntimeException (org.apache.drill.common.exceptions.DrillRuntimeException)1 FragmentContext (org.apache.drill.exec.ops.FragmentContext)1 RecordBatch (org.apache.drill.exec.record.RecordBatch)1 MockScanBatchCreator (org.apache.drill.exec.store.mock.MockScanBatchCreator)1