(Reader reader, LocationInfo current, int batchSize,
TypeDescription column, boolean[] include)
| 123 | } |
| 124 | |
| 125 | static boolean findBadColumns(Reader reader, LocationInfo current, int batchSize, |
| 126 | TypeDescription column, boolean[] include) { |
| 127 | include[column.getId()] = true; |
| 128 | TypeDescription schema = reader.getSchema(); |
| 129 | boolean result = false; |
| 130 | if (column.getChildren() == null) { |
| 131 | int row = 0; |
| 132 | try (RecordReader rows = reader.rows(reader.options().include(include))) { |
| 133 | rows.seekToRow(current.row); |
| 134 | VectorizedRowBatch batch = schema.createRowBatch( |
| 135 | TypeDescription.RowBatchVersion.USE_DECIMAL64, 1); |
| 136 | for(row=0; row < batchSize; ++row) { |
| 137 | rows.nextBatch(batch); |
| 138 | } |
| 139 | } catch (Throwable t) { |
| 140 | System.out.printf("Column %d failed at row %d%n", column.getId(), |
| 141 | current.row + row); |
| 142 | result = true; |
| 143 | } |
| 144 | } else { |
| 145 | for(TypeDescription child: column.getChildren()) { |
| 146 | result |= findBadColumns(reader, current, batchSize, child, include); |
| 147 | } |
| 148 | } |
| 149 | include[column.getId()] = false; |
| 150 | return result; |
| 151 | } |
| 152 | |
| 153 | static void main(Configuration conf, String[] args) throws ParseException { |
| 154 | CommandLine cli = parseCommandLine(args); |
no test coverage detected