Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
# Set compile flags based on the build type.
message("Configured for ${CMAKE_BUILD_TYPE} build (set with cmake -DCMAKE_BUILD_TYPE={release,debug,...})")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_DEBUG}")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "FASTDEBUG")
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_FASTDEBUG})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_FASTDEBUG}")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_RELEASE}")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "PROFILE_GEN")
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_PROFILE_GEN})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_PROFILE_GEN}")
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "PROFILE_BUILD")
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_PROFILE_BUILD})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_PROFILE_BUILD}")
else()
message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}")
endif ()
Expand All @@ -165,6 +165,7 @@ if ("${COMPILER_FAMILY}" STREQUAL "clang")
# http://petereisentraut.blogspot.com/2011/05/ccache-and-clang.html
# http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CLANG_OPTIONS}")
endif()

# Sanity check linking option.
Expand Down Expand Up @@ -559,7 +560,7 @@ if (${CLANG_TIDY_FOUND})
add_custom_target(clang-tidy ${BUILD_SUPPORT_DIR}/run-clang-tidy.sh ${CLANG_TIDY_BIN} ${CMAKE_BINARY_DIR}/compile_commands.json 1
`find ${CMAKE_CURRENT_SOURCE_DIR}/src -name \\*.cc | sed -e '/_generated/g'`)
# runs clang-tidy and exits with a non-zero exit code if any errors are found.
add_custom_target(check-clang-tidy ${BUILD_SUPPORT_DIR}/run-clang-tidy.sh ${CLANG_TIDY_BIN} ${CMAKE_BINARY_DIR}/compile_commands.json
add_custom_target(check-clang-tidy ${BUILD_SUPPORT_DIR}/run-clang-tidy.sh ${CLANG_TIDY_BIN} ${CMAKE_BINARY_DIR}/compile_commands.json
0 `find ${CMAKE_CURRENT_SOURCE_DIR}/src -name \\*.cc |grep -v -F -f ${CMAKE_CURRENT_SOURCE_DIR}/src/.clang-tidy-ignore | sed -e '/_generated/g'`)

endif()
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/parquet/test-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ std::shared_ptr<Table> MakeSimpleTable(
template <typename T>
void ExpectArray(T* expected, Array* result) {
PrimitiveArray* p_array = static_cast<PrimitiveArray*>(result);
for (size_t i = 0; i < result->length(); i++) {
for (int i = 0; i < result->length(); i++) {
EXPECT_EQ(expected[i], reinterpret_cast<const T*>(p_array->data()->data())[i]);
}
}
Expand Down
8 changes: 7 additions & 1 deletion cpp/src/arrow/parquet/writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class FileWriter::Impl {
virtual ~Impl() {}

private:
friend class FileWriter;

MemoryPool* pool_;
PoolBuffer data_buffer_;
PoolBuffer def_levels_buffer_;
Expand Down Expand Up @@ -94,7 +96,7 @@ Status FileWriter::Impl::TypedWriteBatch(::parquet::ColumnWriter* column_writer,
auto buffer_ptr =
reinterpret_cast<typename ParquetType::c_type*>(data_buffer_.mutable_data());
int buffer_idx = 0;
for (size_t i = 0; i < length; i++) {
for (int i = 0; i < length; i++) {
if (data->IsNull(offset + i)) {
def_levels_ptr[i] = 0;
} else {
Expand Down Expand Up @@ -156,6 +158,10 @@ Status FileWriter::Close() {
return impl_->Close();
}

MemoryPool* FileWriter::memory_pool() const {
return impl_->pool_;
}

FileWriter::~FileWriter() {}

Status WriteFlatTable(const Table* table, MemoryPool* pool,
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/arrow/parquet/writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class FileWriter {

virtual ~FileWriter();

MemoryPool* memory_pool() const;

private:
class Impl;
std::unique_ptr<Impl> impl_;
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/arrow/util/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
#define ARROW_UTIL_MACROS_H

// From Google gutil
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
TypeName& operator=(const TypeName&) = delete
#endif

#endif // ARROW_UTIL_MACROS_H