(LocatedFileStatus file,
Reader reader)
| 87 | } |
| 88 | |
| 89 | private boolean addReader(LocatedFileStatus file, |
| 90 | Reader reader) { |
| 91 | // Validate that the schemas are the same |
| 92 | TypeDescription newSchema = reader.getSchema(); |
| 93 | if (schema.equals(newSchema)) { |
| 94 | goodFiles += 1; |
| 95 | rows += reader.getNumberOfRows(); |
| 96 | totalSize += file.getLen(); |
| 97 | checkStripes(file, reader); |
| 98 | ColumnStatistics[] colStats = reader.getStatistics(); |
| 99 | for (int c = 0; c < colStats.length && c < columnSizes.length; c++) { |
| 100 | columnSizes[c] += colStats[c].getBytesOnDisk(); |
| 101 | // Don't double count. Either count the bytes as stripe data or as |
| 102 | // part of a column. |
| 103 | stripeData -= colStats[c].getBytesOnDisk(); |
| 104 | } |
| 105 | } else { |
| 106 | System.err.println("Ignoring " + file.getPath() |
| 107 | + " because of schema mismatch: " + newSchema); |
| 108 | return false; |
| 109 | } |
| 110 | return true; |
| 111 | } |
| 112 | |
| 113 | public boolean addFile(LocatedFileStatus file) throws IOException { |
| 114 | try (Reader reader = OrcFile.createReader(file.getPath(), |
no test coverage detected