Search in sources :

Example 1 with RestrictedJsonRecordReader

use of org.apache.drill.exec.store.mapr.db.json.RestrictedJsonRecordReader in project drill by apache.

the class MapRDBRestrictedScanBatchCreator method getBatch.

@Override
public ScanBatch getBatch(ExecutorFragmentContext context, RestrictedMapRDBSubScan subScan, List<RecordBatch> children) throws ExecutionSetupException {
    Preconditions.checkArgument(children.isEmpty());
    List<RecordReader> readers = Lists.newArrayList();
    for (MapRDBSubScanSpec scanSpec : subScan.getRegionScanSpecList()) {
        try {
            readers.add(new RestrictedJsonRecordReader(scanSpec, subScan.getFormatPlugin(), subScan.getColumns(), context, subScan.getMaxRecordsToRead(), subScan.getSchema()));
        } catch (Exception e1) {
            throw new ExecutionSetupException(e1);
        }
    }
    return new ScanBatch(subScan, context, readers, true);
}
Also used : ExecutionSetupException(org.apache.drill.common.exceptions.ExecutionSetupException) RestrictedJsonRecordReader(org.apache.drill.exec.store.mapr.db.json.RestrictedJsonRecordReader) RecordReader(org.apache.drill.exec.store.RecordReader) ScanBatch(org.apache.drill.exec.physical.impl.ScanBatch) RestrictedJsonRecordReader(org.apache.drill.exec.store.mapr.db.json.RestrictedJsonRecordReader) ExecutionSetupException(org.apache.drill.common.exceptions.ExecutionSetupException)

Aggregations

ExecutionSetupException (org.apache.drill.common.exceptions.ExecutionSetupException)1 ScanBatch (org.apache.drill.exec.physical.impl.ScanBatch)1 RecordReader (org.apache.drill.exec.store.RecordReader)1 RestrictedJsonRecordReader (org.apache.drill.exec.store.mapr.db.json.RestrictedJsonRecordReader)1