parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [parquet-mr] branch master updated: PARQUET-1470: Inputstream leakage in ParquetFileWriter.appendFile (#611)
Date Wed, 06 Feb 2019 08:51:55 GMT
This is an automated email from the ASF dual-hosted git repository.

gabor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-mr.git


The following commit(s) were added to refs/heads/master by this push:
     new 82935e6  PARQUET-1470: Inputstream leakage in ParquetFileWriter.appendFile (#611)
82935e6 is described below

commit 82935e6da8c9f2801d77afba998d3de622e3e7f3
Author: Fokko Driesprong <fokko@driesprong.frl>
AuthorDate: Wed Feb 6 09:51:50 2019 +0100

    PARQUET-1470: Inputstream leakage in ParquetFileWriter.appendFile (#611)
---
 .../src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
index 20efe47..5d4f6b7 100644
--- a/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
+++ b/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java
@@ -664,7 +664,9 @@ public class ParquetFileWriter {
   }
 
   public void appendFile(InputFile file) throws IOException {
-    ParquetFileReader.open(file).appendTo(this);
+    try (ParquetFileReader reader = ParquetFileReader.open(file)) {
+      reader.appendTo(this);
+    }
   }
 
   public int merge(List<InputFile> inputFiles, CodecFactory.BytesCompressor compressor,
String createdBy, long maxBlockSize) throws IOException {


Mime
View raw message