parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdee...@apache.org
Subject [parquet-cpp] branch master updated: PARQUET-1334: [C++] memory_map parameter seems missleading in parquet file opener
Date Thu, 28 Jun 2018 15:23:32 GMT
This is an automated email from the ASF dual-hosted git repository.

mdeepak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new ac5bd82  PARQUET-1334: [C++] memory_map parameter seems missleading in parquet file
opener
ac5bd82 is described below

commit ac5bd8247f6adf8a674a52938c172ab72d1450b2
Author: Philipp Hoch <p.hoch@celonis.com>
AuthorDate: Thu Jun 28 11:23:24 2018 -0400

    PARQUET-1334: [C++] memory_map parameter seems missleading in parquet 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
---
 src/parquet/file_reader.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/parquet/file_reader.cc b/src/parquet/file_reader.cc
index 0632872..ae1c0a7 100644
--- a/src/parquet/file_reader.cc
+++ b/src/parquet/file_reader.cc
@@ -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;
   }
 


Mime
View raw message