Search in sources :

Example 6 with IndexInsertDeleteUpsertOperator

use of org.apache.hyracks.algebricks.core.algebra.operators.logical.IndexInsertDeleteUpsertOperator in project asterixdb by apache.

the class OperatorDeepCopyVisitor method visitIndexInsertDeleteUpsertOperator.

@Override
public ILogicalOperator visitIndexInsertDeleteUpsertOperator(IndexInsertDeleteUpsertOperator op, Void arg) throws AlgebricksException {
    List<Mutable<ILogicalExpression>> newPrimaryKeyExpressions = new ArrayList<>();
    deepCopyExpressionRefs(newPrimaryKeyExpressions, op.getPrimaryKeyExpressions());
    List<Mutable<ILogicalExpression>> newSecondaryKeyExpressions = new ArrayList<>();
    deepCopyExpressionRefs(newSecondaryKeyExpressions, op.getSecondaryKeyExpressions());
    Mutable<ILogicalExpression> newFilterExpression = new MutableObject<>(((AbstractLogicalExpression) op.getFilterExpression()).cloneExpression());
    List<Mutable<ILogicalExpression>> newLSMComponentFilterExpressions = new ArrayList<>();
    deepCopyExpressionRefs(newLSMComponentFilterExpressions, op.getAdditionalFilteringExpressions());
    IndexInsertDeleteUpsertOperator indexInsertDeleteOp = new IndexInsertDeleteUpsertOperator(op.getDataSourceIndex(), newPrimaryKeyExpressions, newSecondaryKeyExpressions, newFilterExpression, op.getOperation(), op.isBulkload(), op.getNumberOfAdditionalNonFilteringFields());
    indexInsertDeleteOp.setAdditionalFilteringExpressions(newLSMComponentFilterExpressions);
    return indexInsertDeleteOp;
}
Also used : Mutable(org.apache.commons.lang3.mutable.Mutable) ILogicalExpression(org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression) ArrayList(java.util.ArrayList) IndexInsertDeleteUpsertOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.IndexInsertDeleteUpsertOperator) MutableObject(org.apache.commons.lang3.mutable.MutableObject)

Aggregations

IndexInsertDeleteUpsertOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.IndexInsertDeleteUpsertOperator)6 ArrayList (java.util.ArrayList)3 Mutable (org.apache.commons.lang3.mutable.Mutable)3 ILogicalExpression (org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression)3 ILogicalOperator (org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)3 AbstractLogicalOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator)3 CommitOperator (org.apache.asterix.algebra.operators.CommitOperator)2 MetadataProvider (org.apache.asterix.metadata.declared.MetadataProvider)2 Dataset (org.apache.asterix.metadata.entities.Dataset)2 MutableObject (org.apache.commons.lang3.mutable.MutableObject)2 AlgebricksPartitionConstraint (org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint)2 LogicalVariable (org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable)2 IVariableTypeEnvironment (org.apache.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment)2 VariableReferenceExpression (org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression)2 IMetadataProvider (org.apache.hyracks.algebricks.core.algebra.metadata.IMetadataProvider)2 DelegateOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.DelegateOperator)2 InsertDeleteUpsertOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.InsertDeleteUpsertOperator)2 HashMap (java.util.HashMap)1 List (java.util.List)1 CommitPOperator (org.apache.asterix.algebra.operators.physical.CommitPOperator)1