Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
PARQUET-1334: [C++] memory_map parameter seems missleading in parquet…
Browse files Browse the repository at this point in the history
… file opener

If memory_map parameter is true, normal file operation is executed, while in negative case, the according memory mapped file operation happens. Seems either be used via inverted logic or being bug.

Author: Philipp Hoch <p.hoch@celonis.com>

Closes #471 from philhoch/bugfix-mixed-up-memory-map-parameter and squashes the following commits:

651cf6b [Philipp Hoch] switched logic within conditional to support memory mapped behavior if requested and readable file accordingly
  • Loading branch information
hochphil authored and Deepak Majeti committed Jun 28, 2018
1 parent be4c532 commit ac5bd82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/parquet/file_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,14 @@ std::unique_ptr<ParquetFileReader> ParquetFileReader::OpenFile(
const std::shared_ptr<FileMetaData>& metadata) {
std::shared_ptr<::arrow::io::ReadableFileInterface> source;
if (memory_map) {
std::shared_ptr<::arrow::io::ReadableFile> handle;
std::shared_ptr<::arrow::io::MemoryMappedFile> handle;
PARQUET_THROW_NOT_OK(
::arrow::io::ReadableFile::Open(path, props.memory_pool(), &handle));
::arrow::io::MemoryMappedFile::Open(path, ::arrow::io::FileMode::READ, &handle));
source = handle;
} else {
std::shared_ptr<::arrow::io::MemoryMappedFile> handle;
std::shared_ptr<::arrow::io::ReadableFile> handle;
PARQUET_THROW_NOT_OK(
::arrow::io::MemoryMappedFile::Open(path, ::arrow::io::FileMode::READ, &handle));
::arrow::io::ReadableFile::Open(path, props.memory_pool(), &handle));
source = handle;
}

Expand Down

0 comments on commit ac5bd82

Please sign in to comment.