Remove unbundled hive support

This commit is contained in:
Azat Khuzhin 2022-01-17 08:06:53 +03:00
parent 1145e32af6
commit 4bd49138b4
6 changed files with 18 additions and 38 deletions

View File

@ -538,7 +538,6 @@ include (cmake/find/cassandra.cmake)
include (cmake/find/sentry.cmake)
include (cmake/find/datasketches.cmake)
include (cmake/find/libprotobuf-mutator.cmake)
include (cmake/find/hive-metastore.cmake)
set (USE_INTERNAL_CITYHASH_LIBRARY ON CACHE INTERNAL "")
find_contrib_lib(cityhash)

View File

@ -1,26 +0,0 @@
option(ENABLE_HIVE "Enable Hive" ${ENABLE_LIBRARIES})
if (NOT ENABLE_HIVE)
message("Hive disabled")
return()
endif()
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/hive-metastore")
message(WARNING "submodule contrib/hive-metastore is missing. to fix try run: \n git submodule update --init")
set(USE_HIVE 0)
elseif (NOT USE_THRIFT)
message(WARNING "Thrift is not found, which is needed by Hive")
set(USE_HIVE 0)
elseif (NOT USE_HDFS)
message(WARNING "HDFS is not found, which is needed by Hive")
set(USE_HIVE 0)
elseif (NOT USE_ORC OR NOT USE_ARROW OR NOT USE_PARQUET)
message(WARNING "ORC/Arrow/Parquet is not found, which are needed by Hive")
set(USE_HIVE 0)
else()
set(USE_HIVE 1)
set(HIVE_METASTORE_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/hive-metastore)
set(HIVE_METASTORE_LIBRARY hivemetastore)
endif()
message (STATUS "Using_Hive=${USE_HIVE}: ${HIVE_METASTORE_INCLUDE_DIR} : ${HIVE_METASTORE_LIBRARY}")

View File

@ -64,6 +64,7 @@ add_subdirectory (rocksdb-cmake)
# parquet/arrow/orc
add_subdirectory (arrow-cmake) # requires: snappy
add_subdirectory (avro-cmake) # requires: snappy
add_subdirectory (hive-metastore-cmake) # requires: thrift/avro/arrow
# TODO: refactor the contrib libraries below this comment.
@ -255,10 +256,6 @@ if (USE_S2_GEOMETRY)
add_subdirectory(s2geometry-cmake)
endif()
if (USE_HIVE)
add_subdirectory (hive-metastore-cmake)
endif()
# Put all targets defined here and in subdirectories under "contrib/<immediate-subdir>" folders in GUI-based IDEs.
# Some of third-party projects may override CMAKE_FOLDER or FOLDER property of their targets, so they would not appear
# in "contrib/..." as originally planned, so we workaround this by fixing FOLDER properties of all targets manually,

View File

@ -1,9 +1,17 @@
option(ENABLE_HIVE "Enable Hive" ${ENABLE_LIBRARIES})
if (NOT ENABLE_HIVE)
message("Hive disabled")
return()
endif()
set (SRCS
${ClickHouse_SOURCE_DIR}/contrib/hive-metastore/hive_metastore_constants.cpp
${ClickHouse_SOURCE_DIR}/contrib/hive-metastore/hive_metastore_types.cpp
${ClickHouse_SOURCE_DIR}/contrib/hive-metastore/ThriftHiveMetastore.cpp
)
add_library(${HIVE_METASTORE_LIBRARY} ${SRCS})
target_link_libraries(${HIVE_METASTORE_LIBRARY} PUBLIC ${THRIFT_LIBRARY})
target_include_directories(${HIVE_METASTORE_LIBRARY} SYSTEM PUBLIC ${HIVE_METASTORE_INCLUDE_DIR})
add_library(_hivemetastore ${SRCS})
add_library(ch_contrib::hivemetastore ALIAS _hivemetastore)
target_link_libraries(_hivemetastore PUBLIC ${THRIFT_LIBRARY})
target_include_directories(_hivemetastore SYSTEM BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/hive-metastore)

View File

@ -120,7 +120,7 @@ if (USE_HDFS)
endif()
add_headers_and_sources(dbms Storages/Cache)
if (USE_HIVE)
if (TARGET ch_contrib::hivemetastore AND TARGET ch_contrib::hdfs)
add_headers_and_sources(dbms Storages/Hive)
endif()
@ -444,9 +444,8 @@ if (USE_HDFS)
dbms_target_include_directories (SYSTEM BEFORE PUBLIC ${HDFS3_INCLUDE_DIR})
endif()
if (USE_HIVE)
dbms_target_link_libraries(PRIVATE hivemetastore)
dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/hive-metastore)
if (TARGET ch_contrib::hivemetastore)
dbms_target_link_libraries(PRIVATE ch_contrib::hivemetastore)
endif()

View File

@ -7,3 +7,6 @@ endif()
if (TARGET ch_contrib::snappy)
set(USE_SNAPPY 1)
endif()
if (TARGET ch_contrib::hivemetastore)
set(USE_HIVE 1)
endif()