Skip to content

Commit

Permalink
HIVE-28008: ParquetFileReader is not closed in ParquetHiveSerDe.readS…
Browse files Browse the repository at this point in the history
…chema (#5013). (Michal Lorek, reviewed by Ayush Saxena, Butao Zhang, Attila Turoczy)
  • Loading branch information
mlorek committed Jan 21, 2024
1 parent 529db39 commit 5093bb1
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -412,8 +412,9 @@ public List<FieldSchema> readSchema(Configuration conf, String file) throws SerD
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);
}
Expand Down

0 comments on commit 5093bb1

Please sign in to comment.