Search in sources :

Example 1 with IBinaryIntegerInspectorFactory

use of org.apache.hyracks.algebricks.data.IBinaryIntegerInspectorFactory 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)

Aggregations

ILogicalOperator (org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator)1 IExpressionRuntimeProvider (org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionRuntimeProvider)1 SplitOperator (org.apache.hyracks.algebricks.core.algebra.operators.logical.SplitOperator)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