MCPcopy Index your code
hub / github.com/apache/orc / findBadColumns

Method findBadColumns

java/tools/src/java/org/apache/orc/tools/ScanData.java:125–151  ·  view source on GitHub ↗
(Reader reader, LocationInfo current, int batchSize,
      TypeDescription column, boolean[] include)

Source from the content-addressed store, hash-verified

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);

Callers 1

mainMethod · 0.95

Calls 9

createRowBatchMethod · 0.95
getChildrenMethod · 0.80
includeMethod · 0.80
getSchemaMethod · 0.65
rowsMethod · 0.65
optionsMethod · 0.65
seekToRowMethod · 0.65
nextBatchMethod · 0.65
getIdMethod · 0.45

Tested by

no test coverage detected