public static void addPartitionInputs(Collection<Partition> parts, Collection<ReadEntity> inputs,
      ReadEntity parentViewInfo, boolean isDirectRead) {
    // Store the inputs in a HashMap since we can't get a ReadEntity from inputs since it is
    // implemented as a set.ReadEntity is used as the key so that the HashMap has the same behavior
    // of equals and hashCode
    Map<ReadEntity, ReadEntity> readEntityMap =
        new LinkedHashMap<>(inputs.size());
    for (ReadEntity input : inputs) {
      readEntityMap.put(input, input);
    }

    for (Partition part : parts) {
      // Don't add the partition or table created during the execution as the input source
      if (isValuesTempTable(part.getTable().getTableName())) {
        continue;
      }

      ReadEntity newInput;
      if (part.getTable().isPartitioned() && !part.getTable().hasNonNativePartitionSupport()) {
        newInput = new ReadEntity(part, parentViewInfo, isDirectRead);
      } else {
        newInput = new ReadEntity(part.getTable(), parentViewInfo, isDirectRead);
      }

      if (readEntityMap.containsKey(newInput)) {
        ReadEntity input = readEntityMap.get(newInput);
        if ((newInput.getParents() != null) && (!newInput.getParents().isEmpty())) {
          input.getParents().addAll(newInput.getParents());
          input.setDirect(input.isDirect() || newInput.isDirect());
        }
      } else {
        readEntityMap.put(newInput, newInput);
      }
    }

    // Add the new ReadEntity that were added to readEntityMap in PlanUtils.addInput
    if (inputs.size() != readEntityMap.size()) {
      inputs.addAll(readEntityMap.keySet());
    }
  }
Check if the table is the temporary table created by VALUES() syntax
@param tableName table name
@return
ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java