class SqlValidatorUtil {

  static void checkIdentifierListForDuplicates(List<SqlNode> columnList,
      SqlValidatorImpl.ValidationErrorFunction validationErrorFunction) {
    final List<List<String>> names = Lists.transform(columnList,
        o -> ((SqlIdentifier) o).names);
    final int i = Util.firstDuplicate(names);
    if (i >= 0) {
      throw validationErrorFunction.apply(columnList.get(i),
          RESOURCE.duplicateNameInColumnList(Util.last(names.get(i))));
    }
  }

  private  SqlValidatorUtil();

}