Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORC-552 fix c++ for centos6. #436

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-covered-switch-default")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-missing-noreturn -Wno-unknown-pragmas")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
set (WARN_FLAGS "${WARN_FLAGS} -Wconversion -Werror")
set (WARN_FLAGS "${WARN_FLAGS} -Wconversion")
if (CMAKE_HOST_APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "11.0")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-c++2a-compat")
endif ()
set (WARN_FLAGS "${WARN_FLAGS} -Werror")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (WARN_FLAGS "-Wall -Wno-unknown-pragmas -Wconversion -Werror")
if (CMAKE_CXX_COMPILER_VERSION STREQUAL "" OR
Expand Down
56 changes: 28 additions & 28 deletions c++/src/ColumnPrinter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ namespace orc {
return std::unique_ptr<ColumnPrinter>(result);
}

VoidColumnPrinter::VoidColumnPrinter(std::string& buffer
): ColumnPrinter(buffer) {
VoidColumnPrinter::VoidColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer) {
// PASS
}

Expand All @@ -302,8 +302,8 @@ namespace orc {
writeString(buffer, "null");
}

LongColumnPrinter::LongColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
LongColumnPrinter::LongColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr) {
// PASS
}
Expand All @@ -324,9 +324,9 @@ namespace orc {
}
}

DoubleColumnPrinter::DoubleColumnPrinter(std::string& buffer,
DoubleColumnPrinter::DoubleColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer),
): ColumnPrinter(_buffer),
data(nullptr),
isFloat(type.getKind() == FLOAT){
// PASS
Expand All @@ -348,8 +348,8 @@ namespace orc {
}
}

Decimal64ColumnPrinter::Decimal64ColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
Decimal64ColumnPrinter::Decimal64ColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr),
scale(0) {
// PASS
Expand Down Expand Up @@ -398,8 +398,8 @@ namespace orc {
}
}

Decimal128ColumnPrinter::Decimal128ColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
Decimal128ColumnPrinter::Decimal128ColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr),
scale(0) {
// PASS
Expand All @@ -419,8 +419,8 @@ namespace orc {
}
}

StringColumnPrinter::StringColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
StringColumnPrinter::StringColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
start(nullptr),
length(nullptr) {
// PASS
Expand Down Expand Up @@ -470,9 +470,9 @@ namespace orc {
}
}

ListColumnPrinter::ListColumnPrinter(std::string& buffer,
ListColumnPrinter::ListColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer),
): ColumnPrinter(_buffer),
offsets(nullptr) {
elementPrinter = createColumnPrinter(buffer, type.getSubtype(0));
}
Expand All @@ -499,9 +499,9 @@ namespace orc {
}
}

MapColumnPrinter::MapColumnPrinter(std::string& buffer,
MapColumnPrinter::MapColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer),
): ColumnPrinter(_buffer),
offsets(nullptr) {
keyPrinter = createColumnPrinter(buffer, type.getSubtype(0));
elementPrinter = createColumnPrinter(buffer, type.getSubtype(1));
Expand Down Expand Up @@ -534,9 +534,9 @@ namespace orc {
}
}

UnionColumnPrinter::UnionColumnPrinter(std::string& buffer,
UnionColumnPrinter::UnionColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer),
): ColumnPrinter(_buffer),
tags(nullptr),
offsets(nullptr) {
for(unsigned int i=0; i < type.getSubtypeCount(); ++i) {
Expand Down Expand Up @@ -577,9 +577,9 @@ namespace orc {
}
}

StructColumnPrinter::StructColumnPrinter(std::string& buffer,
StructColumnPrinter::StructColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer) {
): ColumnPrinter(_buffer) {
for(unsigned int i=0; i < type.getSubtypeCount(); ++i) {
fieldNames.push_back(type.getFieldName(i));
fieldPrinter.push_back(createColumnPrinter(buffer,
Expand Down Expand Up @@ -621,8 +621,8 @@ namespace orc {
}
}

DateColumnPrinter::DateColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
DateColumnPrinter::DateColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr) {
// PASS
}
Expand All @@ -647,8 +647,8 @@ namespace orc {
data = dynamic_cast<const LongVectorBatch&>(batch).data.data();
}

BooleanColumnPrinter::BooleanColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
BooleanColumnPrinter::BooleanColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr) {
// PASS
}
Expand All @@ -666,8 +666,8 @@ namespace orc {
data = dynamic_cast<const LongVectorBatch&>(batch).data.data();
}

BinaryColumnPrinter::BinaryColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
BinaryColumnPrinter::BinaryColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
start(nullptr),
length(nullptr) {
// PASS
Expand Down Expand Up @@ -697,8 +697,8 @@ namespace orc {
length = dynamic_cast<const StringVectorBatch&>(batch).length.data();
}

TimestampColumnPrinter::TimestampColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
TimestampColumnPrinter::TimestampColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
seconds(nullptr),
nanoseconds(nullptr) {
// PASS
Expand Down
9 changes: 5 additions & 4 deletions c++/src/Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,19 @@ namespace orc {
// store position providers for selected colimns
std::unordered_map<uint64_t, PositionProvider> positionProviders;

for (const auto& rowIndex : rowIndexes) {
uint64_t colId = rowIndex.first;
for (auto rowIndex = rowIndexes.cbegin();
rowIndex != rowIndexes.cend(); ++rowIndex) {
uint64_t colId = rowIndex->first;
const proto::RowIndexEntry& entry =
rowIndex.second.entry(static_cast<int32_t>(rowGroupEntryId));
rowIndex->second.entry(static_cast<int32_t>(rowGroupEntryId));

// copy index positions for a specific column
positions.push_back({});
auto& position = positions.back();
for (int pos = 0; pos != entry.positions_size(); ++pos) {
position.push_back(entry.positions(pos));
}
positionProviders.emplace(std::make_pair(colId, PositionProvider(position)));
positionProviders.insert(std::make_pair(colId, PositionProvider(position)));
}

reader->seekToRowGroup(positionProviders);
Expand Down
35 changes: 18 additions & 17 deletions c++/src/Vector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ namespace orc {
return false;
}

LongVectorBatch::LongVectorBatch(uint64_t capacity, MemoryPool& pool
): ColumnVectorBatch(capacity, pool),
data(pool, capacity) {
LongVectorBatch::LongVectorBatch(uint64_t _capacity, MemoryPool& pool
): ColumnVectorBatch(_capacity, pool),
data(pool, _capacity) {
// PASS
}

Expand Down Expand Up @@ -93,9 +93,9 @@ namespace orc {
static_cast<uint64_t>(data.capacity() * sizeof(int64_t));
}

DoubleVectorBatch::DoubleVectorBatch(uint64_t capacity, MemoryPool& pool
): ColumnVectorBatch(capacity, pool),
data(pool, capacity) {
DoubleVectorBatch::DoubleVectorBatch(uint64_t _capacity, MemoryPool& pool
): ColumnVectorBatch(_capacity, pool),
data(pool, _capacity) {
// PASS
}

Expand Down Expand Up @@ -131,10 +131,11 @@ namespace orc {
// PASS
}

EncodedStringVectorBatch::EncodedStringVectorBatch(uint64_t capacity, MemoryPool& pool)
: StringVectorBatch(capacity, pool),
EncodedStringVectorBatch::EncodedStringVectorBatch(uint64_t _capacity,
MemoryPool& pool)
: StringVectorBatch(_capacity, pool),
dictionary(),
index(pool, capacity) {
index(pool, _capacity) {
// PASS
}

Expand All @@ -148,10 +149,10 @@ namespace orc {
return buffer.str();
}

StringVectorBatch::StringVectorBatch(uint64_t capacity, MemoryPool& pool
): ColumnVectorBatch(capacity, pool),
data(pool, capacity),
length(pool, capacity),
StringVectorBatch::StringVectorBatch(uint64_t _capacity, MemoryPool& pool
): ColumnVectorBatch(_capacity, pool),
data(pool, _capacity),
length(pool, _capacity),
blob(pool) {
// PASS
}
Expand Down Expand Up @@ -478,12 +479,12 @@ namespace orc {
return value.toDecimalString(scale);
}

TimestampVectorBatch::TimestampVectorBatch(uint64_t capacity,
TimestampVectorBatch::TimestampVectorBatch(uint64_t _capacity,
MemoryPool& pool
): ColumnVectorBatch(capacity,
): ColumnVectorBatch(_capacity,
pool),
data(pool, capacity),
nanoseconds(pool, capacity) {
data(pool, _capacity),
nanoseconds(pool, _capacity) {
// PASS
}

Expand Down
3 changes: 3 additions & 0 deletions c++/test/TestColumnReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
DIAGNOSTIC_IGNORE("-Winconsistent-missing-override")
DIAGNOSTIC_IGNORE("-Wmissing-variable-declarations")
#endif
#ifdef __GNUC__
DIAGNOSTIC_IGNORE("-Wparentheses")
#endif

namespace orc {
using ::testing::TestWithParam;
Expand Down
2 changes: 1 addition & 1 deletion cmake_modules/FindSnappy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ find_path (SNAPPY_INCLUDE_DIR snappy.h HINTS

find_library (SNAPPY_LIBRARIES NAMES snappy HINTS
${_snappy_path}
PATH_SUFFIXES "lib")
PATH_SUFFIXES "lib" "lib64")

if (SNAPPY_INCLUDE_DIR AND SNAPPY_LIBRARIES)
set (SNAPPY_FOUND TRUE)
Expand Down
2 changes: 1 addition & 1 deletion cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ else ()
set(SNAPPY_INCLUDE_DIR "${SNAPPY_HOME}/include")
set(SNAPPY_STATIC_LIB "${SNAPPY_HOME}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}snappy${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(SNAPPY_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${SNAPPY_HOME}
-DBUILD_SHARED_LIBS=OFF)
-DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=lib)

ExternalProject_Add (snappy_ep
URL "https://github.com/google/snappy/archive/${SNAPPY_VERSION}.tar.gz"
Expand Down