Skip to content

Commit b30c09c

Browse files
ffabbri4Nong Li
authored andcommitted
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 <ffabbri4@bloomberg.net> 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
1 parent 0427442 commit b30c09c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cpp/src/parquet/parquet.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <sstream>
2020
#include <boost/cstdint.hpp>
2121
#include <boost/scoped_ptr.hpp>
22+
#include <boost/shared_ptr.hpp>
2223
#include <boost/unordered_map.hpp>
2324
#include "gen-cpp/parquet_constants.h"
2425
#include "gen-cpp/parquet_types.h"
@@ -212,7 +213,9 @@ inline ByteArray ColumnReader::GetByteArray(int* def_level, int* rep_level) {
212213

213214
inline bool ColumnReader::ReadDefinitionRepetitionLevels(int* def_level, int* rep_level) {
214215
*rep_level = 1;
215-
if (!definition_level_decoder_->Get(def_level)) ParquetException::EofException();
216+
if (definition_level_decoder_ && !definition_level_decoder_->Get(def_level)) {
217+
ParquetException::EofException();
218+
}
216219
--num_buffered_values_;
217220
return *def_level == 0;
218221
}

0 commit comments

Comments
 (0)