@Override public ILogicalOperator visitDelegateOperator(DelegateOperator op, Void arg) throws AlgebricksException { return new DelegateOperator(op.getNewInstanceOfDelegateOperator()); }
@Override public Void visitDelegateOperator(DelegateOperator op, Void arg) throws AlgebricksException { op.getDelegate().getProducedVariables(producedVariables); return null; }
@Override public IVariableTypeEnvironment computeOutputTypeEnvironment(ITypingContext ctx) throws AlgebricksException { return this.createPropagatingAllInputsTypeEnvironment(ctx); }
if (!(eOp.getDelegate() instanceof CommitOperator)) { return false; boolean isSink = ((CommitOperator) eOp.getDelegate()).isSink(); AbstractLogicalOperator descendantOp = (AbstractLogicalOperator) eOp.getInputs().get(0).getValue(); while (descendantOp != null) { if (descendantOp.getOperatorTag() == LogicalOperatorTag.INDEX_INSERT_DELETE_UPSERT) { DelegateOperator extensionOperator = new DelegateOperator(commitOperator); extensionOperator.setSourceLocation(eOp.getSourceLocation()); extensionOperator.setPhysicalOperator(commitPOperator); extensionOperator.getInputs().add(eOp.getInputs().get(0)); context.computeAndSetTypeEnvironmentForOperator(extensionOperator); opRef.setValue(extensionOperator);
private ILogicalOperator translateDelete(DatasetDataSource targetDatasource, Mutable<ILogicalExpression> varRef, List<Mutable<ILogicalExpression>> varRefsForLoading, List<Mutable<ILogicalExpression>> additionalFilteringExpressions, ILogicalOperator assign, ICompiledDmlStatement stmt) throws AlgebricksException { SourceLocation sourceLoc = stmt.getSourceLocation(); if (targetDatasource.getDataset().hasMetaPart()) { throw new CompilationException(ErrorCode.COMPILATION_ERROR, sourceLoc, targetDatasource.getDataset().getDatasetName() + ": delete from dataset is not supported on Datasets with Meta records"); } InsertDeleteUpsertOperator deleteOp = new InsertDeleteUpsertOperator(targetDatasource, varRef, varRefsForLoading, InsertDeleteUpsertOperator.Kind.DELETE, false); deleteOp.setAdditionalFilteringExpressions(additionalFilteringExpressions); deleteOp.getInputs().add(new MutableObject<>(assign)); deleteOp.setSourceLocation(sourceLoc); DelegateOperator leafOperator = new DelegateOperator(new CommitOperator(true)); leafOperator.getInputs().add(new MutableObject<>(deleteOp)); leafOperator.setSourceLocation(sourceLoc); return leafOperator; }
@Override public Boolean visitDelegateOperator(DelegateOperator op, ILogicalOperator arg) throws AlgebricksException { DelegateOperator aop = (DelegateOperator) copyAndSubstituteVar(op, arg); if (aop.getOperatorTag() != LogicalOperatorTag.DELEGATE_OPERATOR) { return Boolean.FALSE; } return Boolean.TRUE; }
public DelegateOperator(IOperatorDelegate delegate) { super(); if (delegate == null) { throw new IllegalArgumentException("delegate cannot be null!"); } this.delegate = delegate; setExecutionMode(delegate.getExecutionMode()); }
private ILogicalOperator translateInsert(DatasetDataSource targetDatasource, Mutable<ILogicalExpression> varRef, List<Mutable<ILogicalExpression>> varRefsForLoading, List<Mutable<ILogicalExpression>> additionalFilteringExpressions, ILogicalOperator assign, ICompiledDmlStatement stmt) throws AlgebricksException { SourceLocation sourceLoc = stmt.getSourceLocation(); if (targetDatasource.getDataset().hasMetaPart()) { throw new CompilationException(ErrorCode.COMPILATION_ERROR, sourceLoc, targetDatasource.getDataset().getDatasetName() + ": insert into dataset is not supported on Datasets with Meta records"); } // Adds the insert operator. InsertDeleteUpsertOperator insertOp = new InsertDeleteUpsertOperator(targetDatasource, varRef, varRefsForLoading, InsertDeleteUpsertOperator.Kind.INSERT, false); insertOp.setAdditionalFilteringExpressions(additionalFilteringExpressions); insertOp.getInputs().add(new MutableObject<>(assign)); insertOp.setSourceLocation(sourceLoc); // Adds the commit operator. CompiledInsertStatement compiledInsert = (CompiledInsertStatement) stmt; Expression returnExpression = compiledInsert.getReturnExpression(); DelegateOperator rootOperator = new DelegateOperator(new CommitOperator(returnExpression == null)); rootOperator.getInputs().add(new MutableObject<>(insertOp)); rootOperator.setSourceLocation(sourceLoc); // Compiles the return expression. return processReturningExpression(rootOperator, insertOp, compiledInsert); }
DelegateOperator delegateOperator = new DelegateOperator(new CommitOperator(returnExpression == null)); delegateOperator.getInputs().add(new MutableObject<>(upsertOp)); delegateOperator.setSourceLocation(sourceLoc); rootOperator = delegateOperator;
@Override public Void visitDelegateOperator(DelegateOperator op, Void arg) throws AlgebricksException { op.getDelegate().getUsedVariables(usedVariables); return null; }
@Override public IVariableTypeEnvironment computeInputTypeEnvironment(ITypingContext ctx) throws AlgebricksException { return this.createPropagatingAllInputsTypeEnvironment(ctx); }
private boolean checkIfRuleIsApplicable(AbstractLogicalOperator op) { if (op.getOperatorTag() != LogicalOperatorTag.DELEGATE_OPERATOR) { return false; } DelegateOperator extensionOp = (DelegateOperator) op; if (!(extensionOp.getDelegate() instanceof CommitOperator)) { return false; } for (int i = 0; i < op.getInputs().size(); ++i) { AbstractLogicalOperator descendantOp = (AbstractLogicalOperator) op.getInputs().get(i).getValue(); if (descendantOp.getOperatorTag() == LogicalOperatorTag.PROJECT || descendantOp.getOperatorTag() == LogicalOperatorTag.ASSIGN) { if (descendantOp.getPhysicalOperator() == null) { return false; } } checkIfRuleIsApplicable(descendantOp); } return true; }
|| op.getOperatorTag() == LogicalOperatorTag.SINK || (op.getOperatorTag() == LogicalOperatorTag.DELEGATE_OPERATOR && ((DelegateOperator) op).getDelegate() instanceof CommitOperator)) { for (Map.Entry<AbstractReplicateOperator, MutableInt> entry : replicateOperators.entrySet()) { if (entry.getKey().getOutputs().size() != entry.getValue().getValue()) {
if (!(eOp.getDelegate() instanceof CommitOperator)) { return false;
&& !(((DelegateOperator) op).getDelegate() instanceof CommitOperator)) { return false;
if (!(eOp.getDelegate() instanceof CommitOperator)) { return false;
if (currentOp.getOperatorTag() == LogicalOperatorTag.DELEGATE_OPERATOR) { DelegateOperator dOp = (DelegateOperator) currentOp; if (!(dOp.getDelegate() instanceof CommitOperator)) { return false; } else if (!((CommitOperator) dOp.getDelegate()).isSink()) { return false;
if (!(eOp.getDelegate() instanceof CommitOperator)) { return false;