private static Map<String, TypeInfo> collectStructFieldNames(ASTNode structTypeNode) throws SemanticException {
    ASTNode fieldListNode = (ASTNode) structTypeNode.getChild(0);
    assert fieldListNode.getType() == HiveParser.TOK_TABCOLLIST;

    Map<String, TypeInfo> result = new LinkedHashMap<>(fieldListNode.getChildCount());
    for (int i = 0; i < fieldListNode.getChildCount(); i++) {
      ASTNode child = (ASTNode) fieldListNode.getChild(i);

      String attributeIdentifier = unescapeIdentifier(child.getChild(0).getText());
      if (result.containsKey(attributeIdentifier)) {
        throw new SemanticException(ErrorMsg.AMBIGUOUS_STRUCT_ATTRIBUTE, attributeIdentifier);
      } else {
        result.put(attributeIdentifier, getComplexTypeTypeInfo((ASTNode) child.getChild(1)));
      }
    }
    return result;
  }
Parse the newly generated SQL statement to get a new AST.
ql/src/java/org/apache/hadoop/hive/ql/parse/ParseUtils.java