private Set<String> getQualifiedAliases(Operator<?> operator, OpWalkerInfo owi) {
      if (operator.getNumChild() != 1) {
        return null;
      }
      Operator<?> child = operator.getChildOperators().get(0);
      if (!(child instanceof JoinOperator || child instanceof LateralViewJoinOperator)) {
        return null;
      }
      if (operator instanceof ReduceSinkOperator &&
          ((ReduceSinkOperator)operator).getInputAliases() != null) {
        String[] aliases = ((ReduceSinkOperator)operator).getInputAliases();
        return new HashSet<String>(Arrays.asList(aliases));
      }
      Set<String> includes = operator.getSchema().getTableNames();
      if (includes.size() == 1 && includes.contains("")) {
        // Reduce sink of group by operator
        return null;
      }
      return includes;
    }
Default processor which just merges its children.
ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java