From b30c09c0408d1a39ccabfe3817af13aaa640e126 Mon Sep 17 00:00:00 2001 From: Fabrizio Fabbri Date: Thu, 2 Apr 2015 15:55:23 -0700 Subject: [PATCH] PARQUET-232: minor compilation issue I find out some very minor issue when I tried to compile the reader on my environment due to some namespace clashing. As example shared_ptr and unordered_map are also in C++11 std namespace. Some compile don't like it. Also I find that with my test files that I'm reading there was a dereference to a null pointer, if the field is required definition_level_decoder_ is null. Author: Fabrizio Fabbri Closes #7 from ffabbri4/candidate and squashes the following commits: 3f8a445 [Fabrizio Fabbri] Fix null pointer when the repetition level is required. 2948584 [Fabrizio Fabbri] Explicit include boost shared pointer header. specify boost::unordered_map as on C++11 is ambiguous. Change-Id: Iec1d78d3e199eac8cc0cfe68324a9bc219d4802e --- cpp/src/parquet/parquet.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/src/parquet/parquet.h b/cpp/src/parquet/parquet.h index a2ac817c6d835..c1a73b7660d19 100644 --- a/cpp/src/parquet/parquet.h +++ b/cpp/src/parquet/parquet.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "gen-cpp/parquet_constants.h" #include "gen-cpp/parquet_types.h" @@ -212,7 +213,9 @@ inline ByteArray ColumnReader::GetByteArray(int* def_level, int* rep_level) { inline bool ColumnReader::ReadDefinitionRepetitionLevels(int* def_level, int* rep_level) { *rep_level = 1; - if (!definition_level_decoder_->Get(def_level)) ParquetException::EofException(); + if (definition_level_decoder_ && !definition_level_decoder_->Get(def_level)) { + ParquetException::EofException(); + } --num_buffered_values_; return *def_level == 0; }