protected List<String> processTableColumnNames(ASTNode tabColName, String tableName) throws SemanticException {
    if (tabColName == null) {
      return Collections.emptyList();
    }
    List<String> targetColNames = new ArrayList<>(tabColName.getChildren().size());
    for(Node col : tabColName.getChildren()) {
      assert ((ASTNode)col).getType() == HiveParser.Identifier :
          "expected token " + HiveParser.Identifier + " found " + ((ASTNode)col).getType();
      targetColNames.add(((ASTNode)col).getText().toLowerCase());
    }
    Set<String> targetColumns = new HashSet<>(targetColNames);
    if(targetColNames.size() != targetColumns.size()) {
      throw new SemanticException(generateErrorMessage(tabColName,
              "Duplicate column name detected in " + tableName + " table schema specification"));
    }
    return targetColNames;
  }
This is phase1 of supporting specifying schema in insert statement
insert into foo(z,y) select a,b from bar;
@see #handleInsertStatementSpec(java.util.List, String, RowResolver, QB, ASTNode)
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java