(List<String> names)
| 86 | } |
| 87 | |
| 88 | private static void validateColumnNames(List<String> names) throws DDFException { |
| 89 | Set<String> columnSet = new HashSet<String>(); |
| 90 | if(names != null) { |
| 91 | for(String name: names) { |
| 92 | if(columnSet.contains(name)) { |
| 93 | throw new DDFException(String.format("Duplicated column name %s", name)); |
| 94 | } else { |
| 95 | if(!Utils.isAlphaNumeric(name)) { |
| 96 | throw new DDFException(String.format("Invalid column name %s, only allow alphanumeric (uppercase and lowercase a-z, numbers 0-9) " + |
| 97 | "and dash (\"-\") and underscore (\"_\")", name)); |
| 98 | } |
| 99 | columnSet.add(name); |
| 100 | } |
| 101 | } |
| 102 | } else { |
| 103 | throw new DDFException("names is null"); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | private List<Column> parseColumnList(String columnList) { |
| 108 | if (Strings.isNullOrEmpty(columnList)) |
no test coverage detected