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

Method addReader

java/tools/src/java/org/apache/orc/tools/ColumnSizes.java:89–111  ·  view source on GitHub ↗
(LocatedFileStatus file,
                            Reader reader)

Source from the content-addressed store, hash-verified

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(),

Callers 2

ColumnSizesMethod · 0.95
addFileMethod · 0.95

Calls 7

checkStripesMethod · 0.95
getSchemaMethod · 0.65
getNumberOfRowsMethod · 0.65
getStatisticsMethod · 0.65
getBytesOnDiskMethod · 0.65
equalsMethod · 0.45
getPathMethod · 0.45

Tested by

no test coverage detected