Search in sources :

Example 1 with WriteResultOperator

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

the class WriteResultPOperator method contributeRuntimeOperator.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void contributeRuntimeOperator(IHyracksJobBuilder builder, JobGenContext context, ILogicalOperator op, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IOperatorSchema outerPlanSchema) throws AlgebricksException {
    WriteResultOperator writeResultOp = (WriteResultOperator) op;
    IMetadataProvider mp = context.getMetadataProvider();
    JobSpecification spec = builder.getJobSpec();
    Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> runtimeAndConstraints = mp.getWriteResultRuntime(dataSource, propagatedSchema, keys, payload, additionalFilteringKeys, context, spec);
    builder.contributeHyracksOperator(writeResultOp, runtimeAndConstraints.first);
    builder.contributeAlgebricksPartitionConstraint(runtimeAndConstraints.first, runtimeAndConstraints.second);
    ILogicalOperator src = writeResultOp.getInputs().get(0).getValue();
    builder.contributeGraphEdge(src, 0, writeResultOp, 0);
}
Also used : WriteResultOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.WriteResultOperator) IOperatorDescriptor(org.apache.hyracks.api.dataflow.IOperatorDescriptor) ILogicalOperator(org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator) AlgebricksPartitionConstraint(org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint) JobSpecification(org.apache.hyracks.api.job.JobSpecification) IMetadataProvider(org.apache.hyracks.algebricks.core.algebra.metadata.IMetadataProvider)

Example 2 with WriteResultOperator

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

the class IsomorphismOperatorVisitor method visitWriteResultOperator.

@Override
public Boolean visitWriteResultOperator(WriteResultOperator op, ILogicalOperator arg) throws AlgebricksException {
    AbstractLogicalOperator aop = (AbstractLogicalOperator) arg;
    if (aop.getOperatorTag() != LogicalOperatorTag.WRITE_RESULT) {
        return Boolean.FALSE;
    }
    WriteResultOperator writeOpArg = (WriteResultOperator) copyAndSubstituteVar(op, arg);
    boolean isomorphic = VariableUtilities.varListEqualUnordered(op.getSchema(), writeOpArg.getSchema());
    if (!op.getDataSource().equals(writeOpArg.getDataSource())) {
        isomorphic = false;
    }
    if (!op.getPayloadExpression().equals(writeOpArg.getPayloadExpression())) {
        isomorphic = false;
    }
    return isomorphic;
}
Also used : AbstractLogicalOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator) WriteResultOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.WriteResultOperator)

Example 3 with WriteResultOperator

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

the class OperatorDeepCopyVisitor method visitWriteResultOperator.

@Override
public ILogicalOperator visitWriteResultOperator(WriteResultOperator op, Void arg) throws AlgebricksException {
    ArrayList<Mutable<ILogicalExpression>> newKeyExpressions = new ArrayList<>();
    deepCopyExpressionRefs(newKeyExpressions, op.getKeyExpressions());
    List<Mutable<ILogicalExpression>> newLSMComponentFilterExpressions = new ArrayList<>();
    deepCopyExpressionRefs(newKeyExpressions, op.getAdditionalFilteringExpressions());
    WriteResultOperator writeResultOp = new WriteResultOperator(op.getDataSource(), deepCopyExpressionRef(op.getPayloadExpression()), newKeyExpressions);
    writeResultOp.setAdditionalFilteringExpressions(newLSMComponentFilterExpressions);
    return writeResultOp;
}
Also used : Mutable(org.apache.commons.lang3.mutable.Mutable) WriteResultOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.WriteResultOperator) ArrayList(java.util.ArrayList)

Aggregations

WriteResultOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.WriteResultOperator)3 ArrayList (java.util.ArrayList)1 Mutable (org.apache.commons.lang3.mutable.Mutable)1 AlgebricksPartitionConstraint (org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint)1 ILogicalOperator (org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)1 IMetadataProvider (org.apache.hyracks.algebricks.core.algebra.metadata.IMetadataProvider)1 AbstractLogicalOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator)1 IOperatorDescriptor (org.apache.hyracks.api.dataflow.IOperatorDescriptor)1 JobSpecification (org.apache.hyracks.api.job.JobSpecification)1