(TypeDescription schema, String column)
| 79 | } |
| 80 | |
| 81 | private static TypeDescription findColumn(TypeDescription schema, String column) { |
| 82 | TypeDescription result = schema; |
| 83 | String[] columnMatcher = column.split("\\."); |
| 84 | |
| 85 | int index = 0; |
| 86 | while (index < columnMatcher.length && |
| 87 | result.getCategory() == TypeDescription.Category.STRUCT) { |
| 88 | |
| 89 | String columnName = columnMatcher[index]; |
| 90 | int prevIndex = index; |
| 91 | |
| 92 | List<TypeDescription> fields = result.getChildren(); |
| 93 | List<String> fieldNames = result.getFieldNames(); |
| 94 | |
| 95 | for (int i = 0; i < fields.size(); i++) { |
| 96 | if (columnName.equalsIgnoreCase(fieldNames.get(i))) { |
| 97 | result = fields.get(i); |
| 98 | index++; |
| 99 | |
| 100 | break; |
| 101 | } |
| 102 | } |
| 103 | if (prevIndex == index) { |
| 104 | return null; |
| 105 | } |
| 106 | } |
| 107 | return result; |
| 108 | } |
| 109 | |
| 110 | public static List<OrcProto.Type> getOrcTypes(TypeDescription typeDescr) { |
| 111 | List<OrcProto.Type> result = new ArrayList<>(); |
no test coverage detected