private void deepCopyInputsAnnotationsAndExecutionMode(ILogicalOperator op, ILogicalOperator arg, AbstractLogicalOperator opCopy) throws AlgebricksException { deepCopyInputs(op, opCopy, arg); copyAnnotations(op, opCopy); copySourceLocation(op, opCopy); opCopy.setExecutionMode(op.getExecutionMode()); }
switch (op.getOperatorTag()) { case DATASOURCESCAN: { op.setExecutionMode(AbstractLogicalOperator.ExecutionMode.PARTITIONED); AbstractLogicalOperator currentOp = op; while (currentOp.getInputs().size() == 1) { child.setExecutionMode(AbstractLogicalOperator.ExecutionMode.PARTITIONED); currentOp = child; AggregateOperator aggOp = (AggregateOperator) op; if (aggOp.isGlobal()) { op.setExecutionMode(AbstractLogicalOperator.ExecutionMode.UNPARTITIONED); forceUnpartitioned = true; GroupByOperator gbyOp = (GroupByOperator) op; if (gbyOp.isGroupAll() && gbyOp.isGlobal()) { op.setExecutionMode(AbstractLogicalOperator.ExecutionMode.UNPARTITIONED); forceUnpartitioned = true; WindowOperator winOp = (WindowOperator) op; if (winOp.getPartitionExpressions().isEmpty()) { op.setExecutionMode(AbstractLogicalOperator.ExecutionMode.UNPARTITIONED); forceUnpartitioned = true; op.setExecutionMode(AbstractLogicalOperator.ExecutionMode.PARTITIONED); exit = true; break; op.setExecutionMode(AbstractLogicalOperator.ExecutionMode.LOCAL);
public static ILogicalOperator deepCopy(ILogicalOperator op) throws AlgebricksException { OperatorDeepCopyVisitor visitor = new OperatorDeepCopyVisitor(); AbstractLogicalOperator copiedOperator = (AbstractLogicalOperator) op.accept(visitor, null); copiedOperator.setSourceLocation(op.getSourceLocation()); copiedOperator.setExecutionMode(op.getExecutionMode()); copiedOperator.getAnnotations().putAll(op.getAnnotations()); copiedOperator.setSchema(op.getSchema()); AbstractLogicalOperator sourceOp = (AbstractLogicalOperator) op; copiedOperator.setPhysicalOperator(sourceOp.getPhysicalOperator()); return copiedOperator; }
AbstractLogicalOperator beforeExchange = new ExchangeOperator(); beforeExchange.setPhysicalOperator(new OneToOneExchangePOperator()); beforeExchange.setExecutionMode(rop.getExecutionMode()); Mutable<ILogicalOperator> beforeExchangeRef = new MutableObject<ILogicalOperator>(beforeExchange); beforeExchange.getInputs().add(candidate); AbstractLogicalOperator exchange = new ExchangeOperator(); exchange.setPhysicalOperator(new OneToOneExchangePOperator()); exchange.setExecutionMode(rop.getExecutionMode()); MutableObject<ILogicalOperator> exchangeRef = new MutableObject<ILogicalOperator>(exchange); exchange.getInputs().add(ropRef); assignOperator.setExecutionMode(rop.getExecutionMode()); assignOperator.setPhysicalOperator(new AssignPOperator()); AbstractLogicalOperator projectOperator = new ProjectOperator(liveVars); projectOperator.setSourceLocation(refSourceLoc); projectOperator.setPhysicalOperator(new StreamProjectPOperator()); projectOperator.setExecutionMode(rop.getExecutionMode()); AbstractLogicalOperator exchOp = new ExchangeOperator(); exchOp.setPhysicalOperator(new OneToOneExchangePOperator()); exchOp.setExecutionMode(rop.getExecutionMode()); exchOp.getInputs().add(ropRef); MutableObject<ILogicalOperator> exchOpRef = new MutableObject<ILogicalOperator>(exchOp); exchg.setExecutionMode(childOp.getExecutionMode()); exchg.getInputs().add(new MutableObject<ILogicalOperator>(childOp)); parentOp.getInputs().set(index, new MutableObject<ILogicalOperator>(exchg));
AbstractLogicalOperator assignTmpOp = (AbstractLogicalOperator) assignsBeforeTopOpRef.get(i).getValue(); assignTmpOp.setExecutionMode(ExecutionMode.PARTITIONED); VariableUtilities.substituteVariables(assignTmpOp, origVarToNewVarInLeftPathMap, context); context.computeAndSetTypeEnvironmentForOperator(assignTmpOp);
replicateOp.setSourceLocation(sourceLoc); replicateOp.getInputs().add(new MutableObject<ILogicalOperator>(probeRootOp)); replicateOp.setExecutionMode(ExecutionMode.PARTITIONED); context.computeAndSetTypeEnvironmentForOperator(replicateOp);
OperatorManipulationUtil.deepCopy(dataSourceScan.getInputs().get(0).getValue()))); context.computeAndSetTypeEnvironmentForOperator(inputOp); inputOp.setExecutionMode(dataSourceScan.getExecutionMode()); } else {
((AbstractLogicalOperator) primaryIndexUnnestOp).setExecutionMode(ExecutionMode.PARTITIONED); if (assignBeforeSelectOp != null) { subTree.getDataSourceRef().setValue(primaryIndexUnnestOp);