Skip to content

Commit

Permalink
PARQUET-232: minor compilation issue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ffabbri4 authored and Nong Li committed Apr 2, 2015
1 parent 0427442 commit b30c09c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpp/src/parquet/parquet.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <sstream>
#include <boost/cstdint.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/unordered_map.hpp>
#include "gen-cpp/parquet_constants.h"
#include "gen-cpp/parquet_types.h"
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b30c09c

Please sign in to comment.