Skip to content

Commit

Permalink
Support to transfer input stream when build ParquetFileReader
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Oct 10, 2024
1 parent eed26b4 commit 957d184
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,23 @@ public ParquetFileReader(Configuration conf, Path file, ParquetMetadata footer)
*/
public ParquetFileReader(Configuration conf, Path file, ParquetMetadata footer, ParquetReadOptions options)
throws IOException {
this(conf, file, footer, null, options);
}

/**
* @param conf the Hadoop Configuration
* @param file Path to a parquet file
* @param footer a {@link ParquetMetadata} footer already read from the file
* @param f a {@link SeekableInputStream} for the parquet file
* @param options {@link ParquetReadOptions}
* @throws IOException if the file can not be opened
*/
public ParquetFileReader(
Configuration conf, Path file, ParquetMetadata footer, SeekableInputStream f, ParquetReadOptions options)
throws IOException {
this.converter = new ParquetMetadataConverter(conf);
this.file = HadoopInputFile.fromPath(file, conf);
this.f = this.file.newStream();
this.f = (null != f ? f : this.file.newStream());
this.fileMetaData = footer.getFileMetaData();
this.fileDecryptor = fileMetaData.getFileDecryptor();
this.options = options;
Expand Down

0 comments on commit 957d184

Please sign in to comment.