public static ReadEntity addInput(Set<ReadEntity> inputs, ReadEntity newInput, boolean mergeIsDirectFlag) {
    // If the input is already present, make sure the new parent is added to the input.
    if (inputs.contains(newInput)) {
      for (ReadEntity input : inputs) {
        if (input.equals(newInput)) {
          if ((newInput.getParents() != null) && (!newInput.getParents().isEmpty())) {
            input.getParents().addAll(newInput.getParents());
            input.setDirect(input.isDirect() || newInput.isDirect());
          } else if (mergeIsDirectFlag) {
            input.setDirect(input.isDirect() || newInput.isDirect());
          }
          return input;
        }
      }
      assert false;
    } else {
      inputs.add(newInput);
      return newInput;
    }
    // make compile happy
    return null;
  }
Remove prefix from "Path -&gt; Alias"
This is required for testing.
In order to verify that path is right, we need to display it in expected test result.
But, mask pattern masks path with some patterns.
So, we need to remove prefix from path which triggers mask pattern.
@param origiKey
@return
ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java