private void compileOpRef(Mutable<ILogicalOperator> opRef, IOperatorDescriptorRegistry spec,
IHyracksJobBuilder builder, IOperatorSchema outerPlanSchema) throws AlgebricksException {
ILogicalOperator op = opRef.getValue();
int n = op.getInputs().size();
IOperatorSchema[] schemas = new IOperatorSchema[n];
int i = 0;
for (Mutable<ILogicalOperator> opChild : op.getInputs()) {
List<Mutable<ILogicalOperator>> parents = operatorVisitedToParents.get(opChild);
if (parents == null) {
parents = new ArrayList<Mutable<ILogicalOperator>>();
operatorVisitedToParents.put(opChild, parents);
parents.add(opRef);
compileOpRef(opChild, spec, builder, outerPlanSchema);
schemas[i++] = context.getSchema(opChild.getValue());
} else {
if (!parents.contains(opRef))
parents.add(opRef);
schemas[i++] = context.getSchema(opChild.getValue());
continue;
}
}
IOperatorSchema opSchema = new OperatorSchemaImpl();
context.putSchema(op, opSchema);
op.getVariablePropagationPolicy().propagateVariables(opSchema, schemas);
op.contributeRuntimeOperator(builder, context, opSchema, schemas, outerPlanSchema);
}