Close input readers when ParquetRewriter setup fails

Open Beginner friendly
#3,667 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
java

Research direction

Start at ParquetRewriter.getFileReaders and trace how input readers are opened and how setup IOExceptions are propagated. Verify that readers opened before a failure are closed before the exception escapes, then run the focused tests for ParquetRewriter or Core to confirm the setup-failure behavior.

Written by the indexing model from the issue text.

Description

Describe the bug, including details regarding any error messages, version, and platform.

ParquetRewriter.getFileReaders opens each input reader into a local list. If opening a later input throws IOException, the exception is propagated without closing readers already opened for earlier inputs. Because construction fails, callers cannot close those readers, which leaks their input streams.

Expected behavior: readers opened before the failure are closed before the setup exception is propagated.

Component(s)

Core

Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
3d 23h
Merged PRs (30d)
30

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/parquet-java

All issues in apache/parquet-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.