This is an automated email from the ASF dual-hosted git repository.
gangwu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-java.git
The following commit(s) were added to refs/heads/master by this push:
new 3c33fabf4 GH-3207: ParquetFileReader supports detachFileInputStream
(#3208)
3c33fabf4 is described below
commit 3c33fabf40d2984a9dd05b1f68d06046113e891b
Author: Cheng Pan <[email protected]>
AuthorDate: Wed May 7 03:32:23 2025 +0000
GH-3207: ParquetFileReader supports detachFileInputStream (#3208)
---
.../main/java/org/apache/parquet/hadoop/ParquetFileReader.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git
a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
index 8ac9898b9..b12a819cd 100644
---
a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
+++
b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java
@@ -729,7 +729,7 @@ public class ParquetFileReader implements Closeable {
return new ParquetFileReader(file, options, f);
}
- protected final SeekableInputStream f;
+ protected SeekableInputStream f;
private final InputFile file;
private final ParquetReadOptions options;
private final Map<ColumnPath, ColumnDescriptor> paths = new HashMap<>();
@@ -1741,6 +1741,14 @@ public class ParquetFileReader implements Closeable {
Util.readOffsetIndex(f, offsetIndexDecryptor, offsetIndexAAD));
}
+ /**
+ * Explicitly detach the the input stream for the file to avoid being closed
via
+ * {@link ParquetFileReader#close()}.
+ */
+ public void detachFileInputStream() {
+ f = null;
+ }
+
@Override
public void close() throws IOException {
try {