apache / apache/parquet-java

Parquet writer classes don't close underlying output stream in case of errors.

Open
#2,727 2 comments 0 reactions 0 assignees View on GitHub
Component: Java Component: Parquet Priority: Major Type: bug
Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
3d 12h
Merged PRs (30d)
33

Description

org.apache.parquet.io.OutputFile interface does not implement Closeable.
In my opinion it implies that created streams are fully managed by parquet-mr classes.
Unfortunately opened stream will not be closed in case of IO or other failure.

There are two places I can find for this problem:
- During writer creation (org.apache.parquet.hadoop.ParquetWriter.Builder#build()) - created stream should be closed if writer creation fails.
- During writer close(org.apache.parquet.hadoop.ParquetWriter#close) - underlying stream should be closed regardless of any faced failures.
Although I didn't examine ParquetReaded that much.

**Reporter**: [Andrei Lopukhov](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=alopukhov)
#### Original Issue Attachments:
- [TestExample.java](https://issues.apache.org/jira/secure/attachment/13053139/TestExample.java)

**Note**: *This issue was originally created as [PARQUET-2216](https://issues.apache.org/jira/browse/PARQUET-2216). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.