protected Map<ASTNode, T> convert(Map<Node, Object> outputs) {
    Map<ASTNode, T> converted = new LinkedHashMap<>();
    for (Map.Entry<Node, Object> entry : outputs.entrySet()) {
      if (entry.getKey() instanceof ASTNode &&
          (entry.getValue() == null || exprFactory.isExprInstance(entry.getValue()))) {
        converted.put((ASTNode)entry.getKey(), (T) entry.getValue());
      } else {
        LOG.warn("Invalid type entry " + entry);
      }
    }
    return converted;
  }
Factory that will be used to create the different expressions.
ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java