You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ay...@apache.org on 2024/01/21 16:49:27 UTC
(hive) branch master updated: HIVE-28008: ParquetFileReader is not closed in ParquetHiveSerDe.readSchema (#5013). (Michal Lorek, reviewed by Ayush Saxena, Butao Zhang, Attila Turoczy)
This is an automated email from the ASF dual-hosted git repository.
ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new 5093bb1ffba HIVE-28008: ParquetFileReader is not closed in ParquetHiveSerDe.readSchema (#5013). (Michal Lorek, reviewed by Ayush Saxena, Butao Zhang, Attila Turoczy)
5093bb1ffba is described below
commit 5093bb1ffba84dd093fbec2b8d6b2fec2764087b
Author: M Lorek <ml...@users.noreply.github.com>
AuthorDate: Sun Jan 21 16:49:21 2024 +0000
HIVE-28008: ParquetFileReader is not closed in ParquetHiveSerDe.readSchema (#5013). (Michal Lorek, reviewed by Ayush Saxena, Butao Zhang, Attila Turoczy)
---
.../org/apache/hadoop/hive/ql/io/parquet/serde/ParquetHiveSerDe.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/serde/ParquetHiveSerDe.java b/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/serde/ParquetHiveSerDe.java
index 881d56cd31f..a3a123ee00c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/serde/ParquetHiveSerDe.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/parquet/serde/ParquetHiveSerDe.java
@@ -412,8 +412,9 @@ public class ParquetHiveSerDe extends AbstractSerDe implements SchemaInference {
FileMetaData metadata;
try {
HadoopInputFile inputFile = HadoopInputFile.fromPath(new Path(file), conf);
- ParquetFileReader reader = ParquetFileReader.open(inputFile);
- metadata = reader.getFileMetaData();
+ try(ParquetFileReader reader = ParquetFileReader.open(inputFile)) {
+ metadata = reader.getFileMetaData();
+ }
} catch (Exception e) {
throw new SerDeException(ErrorMsg.PARQUET_FOOTER_ERROR.getErrorCodedMsg(), e);
}