public static void validateSkewedColumnNameUniqueness(List<String> names)
      throws SemanticException {
    Set<String> lookup = new HashSet<String>();
    for (String name : names) {
      if (lookup.contains(name)) {
        throw new SemanticException(ErrorMsg.SKEWED_TABLE_DUPLICATE_COLUMN_NAMES
            .getMsg(name));
      } else {
        lookup.add(name);
      }
    }
  }
Find out duplicate name.

@param names
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/plan/ValidationUtility.java