Skip to content

Commit

Permalink
PARQUET-468: Use thirdparty Thrift compiler to compile parquet.thrift…
Browse files Browse the repository at this point in the history
… at make time

This also adds a `#define` working around the googletest incompatibility described in PARQUET-470.

Author: Wes McKinney <wesm@apache.org>

Closes apache#55 from wesm/PARQUET-468 and squashes the following commits:

e0338df [Wes McKinney] Auto-generate Thrift C++ bindings from environment Thrift compiler. Add #define workaround for Thrift >= 0.9.2 std::tuple conflict with googletest

Change-Id: I2fce672b43352a15d3246b606a011b35efa54fe1
  • Loading branch information
wesm authored and julienledem committed Feb 18, 2016
1 parent a13b20f commit 218fe8e
Show file tree
Hide file tree
Showing 9 changed files with 584 additions and 3,451 deletions.
4 changes: 2 additions & 2 deletions cpp/src/parquet/column/column-reader-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
// specific language governing permissions and limitations
// under the License.

#include <gtest/gtest.h>

#include <algorithm>
#include <cstdint>
#include <cstdlib>
#include <memory>
#include <string>
#include <vector>

#include <gtest/gtest.h>

#include "parquet/types.h"
#include "parquet/column/page.h"
#include "parquet/column/reader.h"
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/parquet/schema/schema-converter-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
// specific language governing permissions and limitations
// under the License.

#include <gtest/gtest.h>

#include <cstdlib>
#include <memory>
#include <string>
#include <vector>

#include <gtest/gtest.h>

#include "parquet/exception.h"
#include "parquet/schema/converter.h"
#include "parquet/schema/test-util.h"
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/parquet/thrift/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parquet_constants.*
parquet_types.*
30 changes: 22 additions & 8 deletions cpp/src/parquet/thrift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,34 @@
# specific language governing permissions and limitations
# under the License.

add_library(parquet_thrift STATIC
set(THRIFT_SRCS
parquet_constants.cpp
parquet_types.cpp
parquet_types.cpp)

add_library(parquet_thrift STATIC
${THRIFT_SRCS}
)

set_target_properties(parquet_thrift
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}")
set_source_files_properties(${THRIFT_SRCS} PROPERTIES GENERATED TRUE)

# List of thrift output targets
set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/src/parquet/thrift)
set(THRIFT_OUTPUT_FILES "${OUTPUT_DIR}/parquet_types.cpp")
set(THRIFT_OUTPUT_FILES ${THRIFT_OUTPUT_FILES} "${OUTPUT_DIR}/parquet_types.h")
set(THRIFT_OUTPUT_FILES ${THRIFT_OUTPUT_FILES} "${OUTPUT_DIR}/parquet_constants.cpp")
set(THRIFT_OUTPUT_FILES ${THRIFT_OUTPUT_FILES} "${OUTPUT_DIR}/parquet_constants.h")

get_filename_component(ABS_PARQUET_THRIFT parquet.thrift ABSOLUTE)

# Headers: thrift
install(FILES
parquet_types.h
parquet_constants.h
util.h
DESTINATION include/parquet/thrift)
add_custom_command(
OUTPUT ${THRIFT_OUTPUT_FILES}
COMMAND ${THRIFT_COMPILER} --gen cpp -out ${OUTPUT_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/parquet.thrift
DEPENDS ${ABS_PARQUET_THRIFT}
COMMENT "Running thrift compiler on parquet.thrift"
VERBATIM
)

ADD_PARQUET_TEST(serializer-test)
Loading

0 comments on commit 218fe8e

Please sign in to comment.