use of org.apache.drill.exec.store.pojo.PojoRecordReader in project drill by apache.
the class SystemTableBatchCreator method getBatch.
// private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SystemTableBatchCreator.class);
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public ScanBatch getBatch(final FragmentContext context, final SystemTableScan scan, final List<RecordBatch> children) throws ExecutionSetupException {
final SystemTable table = scan.getTable();
final Iterator<Object> iterator = table.getIterator(context);
final RecordReader reader = new PojoRecordReader(table.getPojoClass(), iterator);
return new ScanBatch(scan, context, Collections.singleton(reader).iterator());
}
use of org.apache.drill.exec.store.pojo.PojoRecordReader in project drill by apache.
the class DirectPlan method createDirectPlan.
public static <T> PhysicalPlan createDirectPlan(DrillbitEndpoint endpoint, Iterator<T> iterator, Class<T> clazz) {
PojoRecordReader<T> reader = new PojoRecordReader<T>(clazz, iterator);
DirectGroupScan scan = new DirectGroupScan(reader);
Screen screen = new Screen(scan, endpoint);
PlanPropertiesBuilder propsBuilder = PlanProperties.builder();
propsBuilder.type(PlanType.APACHE_DRILL_PHYSICAL);
propsBuilder.version(1);
propsBuilder.resultMode(ResultMode.EXEC);
propsBuilder.generator(DirectPlan.class.getSimpleName(), "");
return new PhysicalPlan(propsBuilder.build(), DefaultSqlHandler.getPops(screen));
}
Aggregations