Skip to content

Commit

Permalink
PARQUET-1692: [C++] LogicalType::FromThrift error on Centos 7 RPM
Browse files Browse the repository at this point in the history
See details here:
https://issues.apache.org/jira/browse/PARQUET-1692

Closes apache#5900 from orozery/require-thrift-10 and squashes the following commits:

1d9b1ea <Or Ozeri> fix
9cb961c <Or Ozeri> post-review
ee3ff09 <Or Ozeri> remove thrift dependency from RPMs
b8df2db <Or Ozeri> require thrift version 0.10.0

Authored-by: Or Ozeri <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
orozery authored and kou committed Dec 2, 2019
1 parent be6fad5 commit 5c2bb6f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
13 changes: 10 additions & 3 deletions cpp/cmake_modules/FindThrift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ if(Thrift_ROOT)
PATHS ${Thrift_ROOT}
PATH_SUFFIXES "include")
find_program(THRIFT_COMPILER thrift PATHS ${Thrift_ROOT} PATH_SUFFIXES "bin")
if(THRIFT_COMPILER)
extract_thrift_version()
endif()
else()
# THRIFT-4760: The pkgconfig files are currently only installed when using autotools.
# Starting with 0.13, they are also installed for the CMake-based installations of Thrift.
Expand All @@ -78,19 +81,25 @@ else()
HINTS ${THRIFT_PC_PREFIX}
NO_DEFAULT_PATH
PATH_SUFFIXES "bin")
set(THRIFT_VERSION ${THRIFT_PC_VERSION})
else()
find_library(THRIFT_STATIC_LIB thrift${THRIFT_MSVC_STATIC_LIB_SUFFIX}
PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib")
find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h PATH_SUFFIXES "include")
find_program(THRIFT_COMPILER thrift PATH_SUFFIXES "bin")
if(THRIFT_COMPILER)
extract_thrift_version()
endif()
endif()
endif()

find_package_handle_standard_args(Thrift
REQUIRED_VARS
THRIFT_STATIC_LIB
THRIFT_INCLUDE_DIR
THRIFT_COMPILER)
THRIFT_COMPILER
VERSION_VAR
THRIFT_VERSION)

if(Thrift_FOUND OR THRIFT_FOUND)
set(Thrift_FOUND TRUE)
Expand All @@ -104,6 +113,4 @@ if(Thrift_FOUND OR THRIFT_FOUND)
# thrift/windows/config.h for Visual C++.
set_target_properties(Thrift::thrift PROPERTIES INTERFACE_LINK_LIBRARIES "ws2_32")
endif()

extract_thrift_version()
endif()
3 changes: 2 additions & 1 deletion cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,8 @@ macro(build_thrift)
endmacro()

if(ARROW_WITH_THRIFT)
resolve_dependency(Thrift)
# Parquet LogicalType requires Thrift union type support, which works well only since 0.10.0
resolve_dependency_with_version(Thrift 0.10.0)
# TODO: Don't use global includes but rather target_include_directories
include_directories(SYSTEM ${THRIFT_INCLUDE_DIR})

Expand Down
7 changes: 0 additions & 7 deletions dev/tasks/linux-packages/apache-arrow/yum/arrow.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
%define use_meson (%{_centos_ver} >= 8)

%define have_rapidjson (%{_centos_ver} == 7)
%define have_thrift (%{_centos_ver} == 7)

Name: @PACKAGE@
Version: @VERSION@
Expand Down Expand Up @@ -94,9 +93,6 @@ BuildRequires: ncurses-devel
%if %{use_parquet}
BuildRequires: bison
BuildRequires: flex
%if %{have_thrift}
BuildRequires: thrift-devel
%endif
%endif

%if %{use_glib}
Expand Down Expand Up @@ -473,9 +469,6 @@ Libraries and header files for Plasma in-memory object store.
Summary: Runtime libraries for Apache Parquet C++
License: Apache-2.0
Requires: boost%{boost_version}-program-options
%if %{have_thrift}
Requires: thrift
%endif
Requires: %{name}-libs = %{version}-%{release}

%description -n parquet-libs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ RUN \
rpmdevtools \
snappy-devel \
tar \
thrift-devel \
zlib-devel && \
yum clean ${quiet} all
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,5 @@ RUN \
rpmdevtools \
snappy-devel \
tar \
# thrift-devel \
zlib-devel && \
dnf clean ${quiet} all

0 comments on commit 5c2bb6f

Please sign in to comment.