use of org.apache.drill.common.logical.PlanProperties.PlanPropertiesBuilder in project drill by apache.
the class DefaultSqlHandler method convertToPlan.
protected PhysicalPlan convertToPlan(PhysicalOperator op) {
PlanPropertiesBuilder propsBuilder = PlanProperties.builder();
propsBuilder.type(PlanType.APACHE_DRILL_PHYSICAL);
propsBuilder.version(1);
propsBuilder.options(new JSONOptions(context.getOptions().getOptionList()));
propsBuilder.resultMode(ResultMode.EXEC);
propsBuilder.generator(this.getClass().getSimpleName(), "");
return new PhysicalPlan(propsBuilder.build(), getPops(op));
}
use of org.apache.drill.common.logical.PlanProperties.PlanPropertiesBuilder in project drill by apache.
the class PhysicalPlanCreator method build.
public PhysicalPlan build(Prel rootPrel, boolean forceRebuild) {
if (plan != null && !forceRebuild) {
return plan;
}
PlanPropertiesBuilder propsBuilder = PlanProperties.builder();
propsBuilder.type(PlanType.APACHE_DRILL_PHYSICAL);
propsBuilder.version(1);
propsBuilder.resultMode(ResultMode.EXEC);
propsBuilder.generator(PhysicalPlanCreator.class.getName(), "");
try {
// invoke getPhysicalOperator on the root Prel which will recursively invoke it
// on the descendants and we should have a well-formed physical operator tree
PhysicalOperator rootPOP = rootPrel.getPhysicalOperator(this);
if (rootPOP != null) {
//getPhysicalOperator() is supposed to populate this list
assert (popList.size() > 0);
plan = new PhysicalPlan(propsBuilder.build(), popList);
}
} catch (IOException e) {
plan = null;
throw new UnsupportedOperationException("Physical plan created failed with error : " + e.toString());
}
return plan;
}
use of org.apache.drill.common.logical.PlanProperties.PlanPropertiesBuilder 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