LOG.info(MessageFormat.format(
"Analyzing Parquet file metadata ({0}): {1}",
context.getDataType().getSimpleName(),
status.getPath()));
}
BlockMap blockMap = BlockMap.create(
status.getPath().toString(),
status.getLen(),
BlockMap.computeBlocks(context.getFileSystem(), status),
false);
for (BlockMetaData block : footer.getParquetMetadata().getBlocks()) {
if (block.getColumns().isEmpty()) {
continue;
}
long begin = Long.MAX_VALUE;
long end = -1L;
for (ColumnChunkMetaData column : block.getColumns()) {
long offset = column.getFirstDataPageOffset();
long size = column.getTotalSize();
begin = Math.min(begin, offset);
end = Math.max(end, offset + size);
}
assert begin >= 0;
assert end >= 0;
DirectInputFragment fragment = blockMap.get(begin, end);
if (LOG.isDebugEnabled()) {
LOG.debug(MessageFormat.format(
"Detect Parquet file block: path={0}, rows={1}, range={2}+{3}, allocation={4}",
status.getPath(),
block.getRowCount(),