pan3793 commented on code in PR #3165:
URL: https://github.com/apache/parquet-java/pull/3165#discussion_r2160605932
##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java:
##########
@@ -925,19 +940,70 @@ public ParquetFileReader(InputFile file,
ParquetReadOptions options) throws IOEx
this(file, options, file.newStream());
}
+ /**
+ * @param file Path to a parquet file
+ * @param options {@link ParquetReadOptions}
+ * @param f a {@link SeekableInputStream} for the parquet file
+ * @throws IOException if the file can not be opened
+ */
public ParquetFileReader(InputFile file, ParquetReadOptions options,
SeekableInputStream f) throws IOException {
this.converter = new ParquetMetadataConverter(options);
this.file = file;
this.f = f;
this.options = options;
try {
this.footer = readFooter(file, options, f, converter);
- } catch (Exception e) {
+ } catch (IOException e) {
// In case that reading footer throws an exception in the constructor,
the new stream
+ // should be closed. Otherwise, there's no way to close this
outside.
Review Comment:
```suggestion
// should be closed. Otherwise, there's no way to close this outside.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]