use of org.apache.drill.exec.physical.base.PhysicalOperator in project drill by apache.
the class ProducerConsumerPrel method getPhysicalOperator.
@Override
public PhysicalOperator getPhysicalOperator(PhysicalPlanCreator creator) throws IOException {
Prel child = (Prel) this.getInput();
PhysicalOperator childPOP = child.getPhysicalOperator(creator);
ProducerConsumer pop = new ProducerConsumer(childPOP, queueSize);
return creator.addMetadata(this, pop);
}
use of org.apache.drill.exec.physical.base.PhysicalOperator in project drill by apache.
the class HashToRandomExchangePrel method getPhysicalOperator.
public PhysicalOperator getPhysicalOperator(PhysicalPlanCreator creator) throws IOException {
Prel child = (Prel) this.getInput();
PhysicalOperator childPOP = child.getPhysicalOperator(creator);
if (PrelUtil.getSettings(getCluster()).isSingleMode()) {
return childPOP;
}
// TODO - refactor to different exchange name
HashToRandomExchange g = new HashToRandomExchange(childPOP, HashPrelUtil.getHashExpression(this.fields, getInput().getRowType()));
return creator.addMetadata(this, g);
}
use of org.apache.drill.exec.physical.base.PhysicalOperator in project drill by apache.
the class NestedLoopJoinPrel method getPhysicalOperator.
@Override
public PhysicalOperator getPhysicalOperator(PhysicalPlanCreator creator) throws IOException {
PhysicalOperator leftPop = ((Prel) left).getPhysicalOperator(creator);
PhysicalOperator rightPop = ((Prel) right).getPhysicalOperator(creator);
/*
Raw expression will be transformed into its logical representation. For example:
Query:
select t1.c1, t2.c1, t2.c2 from t1 inner join t2 on t1.c1 between t2.c1 and t2.c2
Raw expression:
AND(>=($0, $1), <=($0, $2))
Logical expression:
FunctionCall [func=booleanAnd,
args=[FunctionCall [func=greater_than_or_equal_to, args=[`i1`, `i10`]],
FunctionCall [func=less_than_or_equal_to, args=[`i1`, `i2`]]]
Both tables have the same column name thus duplicated column name in second table are renamed: i1 -> i10.
*/
LogicalExpression condition = DrillOptiq.toDrill(new DrillParseContext(PrelUtil.getSettings(getCluster())), getInputs(), getCondition());
NestedLoopJoinPOP nlj = new NestedLoopJoinPOP(leftPop, rightPop, getJoinType(), condition);
return creator.addMetadata(this, nlj);
}
use of org.apache.drill.exec.physical.base.PhysicalOperator in project drill by apache.
the class ScreenPrel method getPhysicalOperator.
@Override
public PhysicalOperator getPhysicalOperator(PhysicalPlanCreator creator) throws IOException {
Prel child = (Prel) this.getInput();
PhysicalOperator childPOP = child.getPhysicalOperator(creator);
Screen s = new Screen(childPOP, creator.getContext().getCurrentEndpoint());
return creator.addMetadata(this, s);
}
use of org.apache.drill.exec.physical.base.PhysicalOperator in project drill by apache.
the class LimitPrel method getPhysicalOperator.
@Override
public PhysicalOperator getPhysicalOperator(PhysicalPlanCreator creator) throws IOException {
Prel child = (Prel) this.getInput();
PhysicalOperator childPOP = child.getPhysicalOperator(creator);
// First offset to include into results (inclusive). Null implies it is starting from offset 0
int first = offset != null ? Math.max(0, RexLiteral.intValue(offset)) : 0;
// Last offset to stop including into results (exclusive), translating fetch row counts into an offset.
// Null value implies including entire remaining result set from first offset
Integer last = fetch != null ? Math.max(0, RexLiteral.intValue(fetch)) + first : null;
Limit limit = new Limit(childPOP, first, last);
return creator.addMetadata(this, limit);
}
Aggregations