Skip to content

[C++][Parquet] ParquetFileReader::Close() doesn't release pre-buffered data #55715

Closed

Description

@kou

Describe the enhancement requested

ParquetFileReader::Close() doesn't release pre-buffered data. Pre-buffering is enabled by default.

If we use MemoryMappedFile, the pre-buffered data refers to the mapped memory. So the file is still mapped after we close the reader and the source. The file is unmapped only when the reader is destroyed.

This is a problem on Windows because we can't remove a mapped file. For example, this fails on Windows:

  1. Open a file with MemoryMappedFile
  2. Read data with the default ArrowReaderProperties
  3. Close the reader and the source
  4. Remove the file
ARROW_ASSIGN_OR_RAISE(
    auto source,
    arrow::io::MemoryMappedFile::Open(path, arrow::io::FileMode::READ));
ARROW_ASSIGN_OR_RAISE(auto reader,
                      parquet::arrow::OpenFile(source, arrow::default_memory_pool()));
std::shared_ptr<arrow::Table> table;
ARROW_RETURN_NOT_OK(reader->ReadTable(&table));
table.reset();
reader->parquet_reader()->Close();
ARROW_RETURN_NOT_OK(source->Close());
// The file is still mapped here.

Component(s)

C++, Parquet

Activity

  1. added a commit that references this issue on Nov 22, 2026
  2. added this to the 27.0.0 milestone on Nov 22, 2026
  3. kou commented on Nov 22, 2026

    @kou
    MemberAuthor

    Issue resolved by pull request 55716
    #55716

  4. self-assigned this
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions