Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ public long defaultBlockSize() {

private static class ParquetInputFile implements InputFile {
private final org.apache.iceberg.io.InputFile file;
private org.apache.iceberg.io.SeekableInputStream icebergHadoopStream;

private ParquetInputFile(org.apache.iceberg.io.InputFile file) {
this.file = file;
this.icebergHadoopStream = null;
}

@Override
Expand All @@ -178,7 +180,8 @@ public long getLength() throws IOException {

@Override
public SeekableInputStream newStream() throws IOException {
return stream(file.newStream());
icebergHadoopStream = file.newStream();
return stream(icebergHadoopStream);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look correct to me. The InputFile is a factory interface and is not responsible for keeping references to the streams that are created.

Copy link
Copy Markdown
Author

@velctor velctor Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that, but the org.apache.iceberg.io.SeekableStream object will be GC after this.f = file.newStream(); in org.apache.parquet.hadoop.ParquetFileReader class. It is difficult to modify the code in the parquet library, so this may be an easier way to solve this problem, under the premise of keeping #90. I want to know if you have any other ideas.

}
}
}