use of org.apache.drill.common.logical.data.SinkOperator in project drill by apache.
the class BasicOptimizer method optimize.
@Override
public PhysicalPlan optimize(final OptimizationContext context, final LogicalPlan plan) throws OptimizerException {
final Object obj = new Object();
final Collection<SinkOperator> roots = plan.getGraph().getRoots();
final List<PhysicalOperator> physOps = new ArrayList<>(roots.size());
final LogicalConverter converter = new LogicalConverter(plan);
for (SinkOperator op : roots) {
final PhysicalOperator pop = op.accept(converter, obj);
physOps.add(pop);
}
final PlanProperties logicalProperties = plan.getProperties();
final PlanProperties props = PlanProperties.builder().type(PlanProperties.PlanType.APACHE_DRILL_PHYSICAL).version(logicalProperties.version).generator(logicalProperties.generator).options(new JSONOptions(context.getOptions().getOptionList())).build();
return new PhysicalPlan(props, physOps);
}
use of org.apache.drill.common.logical.data.SinkOperator in project drill by axbaretto.
the class BasicOptimizer method optimize.
@Override
public PhysicalPlan optimize(final OptimizationContext context, final LogicalPlan plan) throws OptimizerException {
final Object obj = new Object();
final Collection<SinkOperator> roots = plan.getGraph().getRoots();
final List<PhysicalOperator> physOps = new ArrayList<>(roots.size());
final LogicalConverter converter = new LogicalConverter(plan);
for (SinkOperator op : roots) {
final PhysicalOperator pop = op.accept(converter, obj);
physOps.add(pop);
}
final PlanProperties logicalProperties = plan.getProperties();
final PlanProperties props = PlanProperties.builder().type(PlanProperties.PlanType.APACHE_DRILL_PHYSICAL).version(logicalProperties.version).generator(logicalProperties.generator).options(new JSONOptions(context.getOptions().getOptionList())).build();
final PhysicalPlan p = new PhysicalPlan(props, physOps);
return p;
}
Aggregations