private boolean isDescendant(Node ans, Node des) {
      if (ans.getChildren() == null) {
        return false;
      }
      for (Node c : ans.getChildren()) {
        if (c == des) {
          return true;
        }
        if (isDescendant(c, des)) {
          return true;
        }
      }
      return false;
    }
Returns true if des is a descendant of ans (ancestor)
ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java