public static <T extends OperatorDesc> Operator<T> getAndMakeChild(
      T conf, Operator oplist0, Operator... oplist) {
    Operator<T> ret = get(oplist0.getCompilationOpContext(), (Class<T>) conf.getClass());
    ret.setConf(conf);

    // Add the new operator as child of each of the passed in operators
    List<Operator> children = oplist0.getChildOperators();
    children.add(ret);
    oplist0.setChildOperators(children);
    for (Operator op : oplist) {
      children = op.getChildOperators();
      children.add(ret);
      op.setChildOperators(children);
    }

    // add parents for the newly created operator
    List<Operator<? extends OperatorDesc>> parent =
      new ArrayList<Operator<? extends OperatorDesc>>();
    parent.add(oplist0);
    for (Operator op : oplist) {
      parent.add(op);
    }

    ret.setParentOperators(parent);

    return (ret);
  }
Returns an operator given the conf and a list of parent operators.
ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorFactory.java