Skip to content

Commit 82daf68

Browse files
committed
UT
1 parent 3038220 commit 82daf68

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

parquet-hadoop/src/test/java/org/apache/parquet/hadoop/TestDataPageChecksums.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
import java.util.zip.CRC32;
3737
import org.apache.hadoop.conf.Configuration;
3838
import org.apache.hadoop.fs.Path;
39+
import org.apache.parquet.HadoopReadOptions;
40+
import org.apache.parquet.ParquetReadOptions;
3941
import org.apache.parquet.bytes.BytesInput;
4042
import org.apache.parquet.bytes.HeapByteBufferAllocator;
4143
import org.apache.parquet.bytes.TrackingByteBufferAllocator;
@@ -688,8 +690,13 @@ private int getDataOffset(Page page) {
688690
*/
689691
private ParquetFileReader getParquetFileReader(Path path, Configuration conf, List<ColumnDescriptor> columns)
690692
throws IOException {
691-
ParquetMetadata footer = ParquetFileReader.readFooter(conf, path);
692-
return new ParquetFileReader(conf, footer.getFileMetaData(), path, footer.getBlocks(), columns);
693+
HadoopInputFile inputFile = HadoopInputFile.fromPath(path, conf);
694+
SeekableInputStream inputStream = inputFile.newStream();
695+
ParquetReadOptions readOptions = HadoopReadOptions.builder(conf).build();
696+
ParquetMetadata footer = ParquetFileReader.readFooter(inputFile, readOptions, inputStream);
697+
ParquetFileReader reader = ParquetFileReader.open(inputFile, footer, readOptions, inputStream);
698+
reader.setRequestedSchema(columns);
699+
return reader;
693700
}
694701

695702
/**

0 commit comments

Comments
 (0)