private static Integer getTopLevelParentId(Integer id, Map<Integer, Integer> parentMap) {
    if (parentMap.get(id) == null) {
      return id;
    } else {
      return getTopLevelParentId(parentMap.get(id), parentMap);
    }
  }
Recursively builds 2 maps:
 ID to type description
 child to parent type description ID
@param typeDescription - the considered type description, root on first invocation
@param idMap
@param parentIdMap
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java