From 68fc3e761d377ee81a51ca76cabd6e597db9309a Mon Sep 17 00:00:00 2001 From: taiyang-li <654010905@qq.com> Date: Wed, 10 Nov 2021 10:53:03 +0800 Subject: [PATCH] fix build error --- contrib/hive-metastore/CMakeLists.txt | 9 --------- src/CMakeLists.txt | 1 + src/Interpreters/Context.cpp | 8 ++++---- src/Interpreters/Context.h | 4 ++-- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/contrib/hive-metastore/CMakeLists.txt b/contrib/hive-metastore/CMakeLists.txt index c4c59490b05..0792093cfb1 100644 --- a/contrib/hive-metastore/CMakeLists.txt +++ b/contrib/hive-metastore/CMakeLists.txt @@ -4,15 +4,6 @@ set (SRCS ${CMAKE_CURRENT_LIST_DIR}/ThriftHiveMetastore.cpp ) -# set(THRIFT_COMPILER_PATH ${ClickHouse_BINARY_DIR}/contrib/thrift-cmake/thrift-compiler) -# add_custom_command( -# OUTPUT ${SRCS} -# COMMAND ${THRIFT_COMPILER_PATH} -# ARGS -r --gen cpp -out ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/hive_metastore.thrift -# COMMENT "Running cpp thrift compiler for hive_metastore.thrift" -# DEPENDS ${THRIFT_COMPILER} -# VERBATIM) - add_library(hivemetastore ${SRCS}) target_link_libraries(hivemetastore PUBLIC ${THRIFT_LIBRARY}) target_include_directories(hivemetastore SYSTEM PUBLIC ${CMAKE_CURRENT_LIST_DIR}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2fdffecca08..dc2cc9a2a66 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -450,6 +450,7 @@ if (USE_HDFS) if (USE_ORC AND USE_PARQUET) dbms_target_link_libraries(PRIVATE hivemetastore) + dbms_target_include_directories(SYSTEM BEFORE PUBLIC ${ClickHouse_SOURCE_DIR}/contrib/hive-metastore) endif() endif() diff --git a/src/Interpreters/Context.cpp b/src/Interpreters/Context.cpp index a580c6dc923..6baf9d00d0b 100644 --- a/src/Interpreters/Context.cpp +++ b/src/Interpreters/Context.cpp @@ -88,7 +88,7 @@ #include #include -#if USE_HDFS +#if USE_HDFS && USE_ORC && USE_PARQUET #include #include #include @@ -163,7 +163,7 @@ struct ContextSharedPart mutable std::mutex storage_policies_mutex; /// Separate mutex for re-initialization of zookeeper session. This operation could take a long time and must not interfere with another operations. mutable std::mutex zookeeper_mutex; -#if USE_HDFS +#if USE_HDFS && USE_ORC && USE_PARQUET /// Separate mutex for re-initialization of hive metastore client. This operation could take a long time and must not interfere with another operations. mutable std::mutex hive_metastore_mutex; #endif @@ -179,7 +179,7 @@ struct ContextSharedPart mutable std::map auxiliary_zookeepers; /// Map for auxiliary ZooKeeper clients. ConfigurationPtr auxiliary_zookeepers_config; /// Stores auxiliary zookeepers configs -#if USE_HDFS +#if USE_HDFS && USE_ORC && USE_PARQUET mutable std::map hive_metastore_clients; /// Map for hive metastore clients #endif @@ -1824,7 +1824,7 @@ zkutil::ZooKeeperPtr Context::getZooKeeper() const return shared->zookeeper; } -#if USE_HDFS +#if USE_HDFS && USE_ORC && USE_PARQUET HMSClientPtr Context::getHMSClient(const String & name) const { using namespace apache::thrift; diff --git a/src/Interpreters/Context.h b/src/Interpreters/Context.h index 47f35b8acf0..c2d97bc8127 100644 --- a/src/Interpreters/Context.h +++ b/src/Interpreters/Context.h @@ -174,7 +174,7 @@ private: std::unique_ptr shared; }; -#if USE_HDFS +#if USE_HDFS && USE_ORC && USE_PARQUET class HMSClient; using HMSClientPtr = std::shared_ptr; #endif @@ -693,7 +693,7 @@ public: // Reload Zookeeper void reloadZooKeeperIfChanged(const ConfigurationPtr & config) const; -#if USE_HDFS +#if USE_HDFS && USE_ORC && USE_PARQUET HMSClientPtr getHMSClient(const String & name) const; #endif