Search in sources :

Example 1 with SplitOperator

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

the class LogicalOperatorDeepCopyWithNewVariablesVisitor method visitSplitOperator.

@Override
public ILogicalOperator visitSplitOperator(SplitOperator op, ILogicalOperator arg) throws AlgebricksException {
    SplitOperator opCopy = new SplitOperator(op.getOutputArity(), op.getBranchingExpression());
    deepCopyInputsAnnotationsAndExecutionMode(op, arg, opCopy);
    return opCopy;
}
Also used : SplitOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.SplitOperator)

Example 2 with SplitOperator

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

the class SplitPOperator method contributeRuntimeOperator.

@Override
public void contributeRuntimeOperator(IHyracksJobBuilder builder, JobGenContext context, ILogicalOperator op, IOperatorSchema propagatedSchema, IOperatorSchema[] inputSchemas, IOperatorSchema outerPlanSchema) throws AlgebricksException {
    SplitOperator sop = (SplitOperator) op;
    int outputArity = sop.getOutputArity();
    int defaultBranch = sop.getDefaultBranch();
    boolean propageToAllBranchAsDefault = sop.getPropageToAllBranchAsDefault();
    IOperatorDescriptorRegistry spec = builder.getJobSpec();
    RecordDescriptor recDescriptor = JobGenHelper.mkRecordDescriptor(context.getTypeEnvironment(op), propagatedSchema, context);
    IExpressionRuntimeProvider expressionRuntimeProvider = context.getExpressionRuntimeProvider();
    IScalarEvaluatorFactory brachingExprEvalFactory = expressionRuntimeProvider.createEvaluatorFactory(sop.getBranchingExpression().getValue(), context.getTypeEnvironment(op), inputSchemas, context);
    IBinaryIntegerInspectorFactory intInsepctorFactory = context.getBinaryIntegerInspectorFactory();
    SplitOperatorDescriptor splitOpDesc = new SplitOperatorDescriptor(spec, recDescriptor, outputArity, brachingExprEvalFactory, intInsepctorFactory, defaultBranch, propageToAllBranchAsDefault);
    contributeOpDesc(builder, (AbstractLogicalOperator) op, splitOpDesc);
    ILogicalOperator src = op.getInputs().get(0).getValue();
    builder.contributeGraphEdge(src, 0, op, 0);
}
Also used : IExpressionRuntimeProvider(org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionRuntimeProvider) SplitOperatorDescriptor(org.apache.hyracks.algebricks.runtime.operators.std.SplitOperatorDescriptor) RecordDescriptor(org.apache.hyracks.api.dataflow.value.RecordDescriptor) ILogicalOperator(org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator) SplitOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.SplitOperator) IOperatorDescriptorRegistry(org.apache.hyracks.api.job.IOperatorDescriptorRegistry) IBinaryIntegerInspectorFactory(org.apache.hyracks.algebricks.data.IBinaryIntegerInspectorFactory) IScalarEvaluatorFactory(org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory)

Example 3 with SplitOperator

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

the class IsomorphismOperatorVisitor method visitSplitOperator.

@Override
public Boolean visitSplitOperator(SplitOperator op, ILogicalOperator arg) throws AlgebricksException {
    AbstractLogicalOperator aop = (AbstractLogicalOperator) arg;
    if (aop.getOperatorTag() != LogicalOperatorTag.SPLIT) {
        return Boolean.FALSE;
    }
    SplitOperator sOpArg = (SplitOperator) copyAndSubstituteVar(op, arg);
    boolean isomorphic = op.getBranchingExpression().getValue().equals(sOpArg.getBranchingExpression().getValue());
    return isomorphic;
}
Also used : AbstractLogicalOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator) SplitOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.SplitOperator)

Aggregations

SplitOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.SplitOperator)3 ILogicalOperator (org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)1 IExpressionRuntimeProvider (org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionRuntimeProvider)1 AbstractLogicalOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator)1 IBinaryIntegerInspectorFactory (org.apache.hyracks.algebricks.data.IBinaryIntegerInspectorFactory)1 IScalarEvaluatorFactory (org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory)1 SplitOperatorDescriptor (org.apache.hyracks.algebricks.runtime.operators.std.SplitOperatorDescriptor)1 RecordDescriptor (org.apache.hyracks.api.dataflow.value.RecordDescriptor)1 IOperatorDescriptorRegistry (org.apache.hyracks.api.job.IOperatorDescriptorRegistry)1