}
public static List<Footer> readSummaryFile(Configuration configuration, FileStatus summaryStatus) throws IOException {
final Path parent = summaryStatus.getPath().getParent();
ParquetMetadata mergedFooters = readFooter(configuration, summaryStatus);
Map<Path, ParquetMetadata> footers = new HashMap<Path, ParquetMetadata>();
List<BlockMetaData> blocks = mergedFooters.getBlocks();
for (BlockMetaData block : blocks) {
String path = block.getPath();
Path fullPath = new Path(parent, path);
ParquetMetadata current = footers.get(fullPath);
if (current == null) {
current = new ParquetMetadata(mergedFooters.getFileMetaData(), new ArrayList<BlockMetaData>());
footers.put(fullPath, current);
}
current.getBlocks().add(block);
}
List<Footer> result = new ArrayList<Footer>();
for (Entry<Path, ParquetMetadata> entry : footers.entrySet()) {
result.add(new Footer(entry.getKey(), entry.getValue()));
}