diff --git a/.clangd b/.clangd index d2759b254b1d74..ffe5462b166add 100644 --- a/.clangd +++ b/.clangd @@ -18,3 +18,8 @@ Diagnostics: UnusedIncludes: Strict +If: + PathMatch: be/test/.* + +CompileFlags: + CompilationDatabase: be/ut_build_ASAN/ diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt index da978abdf409ba..2eb4645d10ffe7 100644 --- a/be/CMakeLists.txt +++ b/be/CMakeLists.txt @@ -60,7 +60,6 @@ endif () # Set boost/stacktrace use backtrace api to unwind if (NOT OS_MACOSX) add_definitions(-DBOOST_STACKTRACE_USE_BACKTRACE) - #add_definitions(-DPRINT_ALL_ERR_STATUS_STACKTRACE) else() add_definitions(-DBOOST_STACKTRACE_USE_NOOP) endif() @@ -118,8 +117,8 @@ option(WITH_MYSQL "Support access MySQL" ON) # Check gcc if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0") - message(FATAL_ERROR "Need GCC version at least 11.0") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.1") + message(FATAL_ERROR "Need GCC version at least 11.1") endif() endif() @@ -490,27 +489,25 @@ if (NOT CUSTUM_LINKER_COMMAND STREQUAL "ld") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=${CUSTUM_LINKER_COMMAND}") endif() -if (USE_LIBCPP AND COMPILER_CLANG) - set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -stdlib=libc++") - if (NOT OS_MACOSX) - set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -lstdc++") - endif() - add_definitions(-DUSE_LIBCPP) -endif() - if (COMPILER_GCC) - # Avoid GCC 11 false alarm - # https://stackoverflow.com/questions/67584073/gcc-11-false-array-subscript-is-partly-outside-array-bounds-warning - # https://stackoverflow.com/questions/69426070/gcc-11-order-of-arguments-triggers-false-positive-wstringop-overflow-is-this-bu - set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-array-bounds -Wno-stringop-overread") - add_compile_options(-Wno-stringop-overflow -fdiagnostics-color=always) + add_compile_options(-fdiagnostics-color=always -Wno-array-bounds -Wno-stringop-overread) endif () if (COMPILER_CLANG) - add_compile_options(-fcolor-diagnostics -fno-limit-debug-info) + add_compile_options(-fcolor-diagnostics -fno-limit-debug-info -Wpedantic) + add_compile_options(-Wno-zero-length-array -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -Wno-vla-extension -Wno-c++20-designator -Wno-gnu-label-as-value -Wno-embedded-directive -Wno-array-bounds) if(MAKE_TEST STREQUAL "OFF") add_compile_options(-Qunused-arguments) endif() + if (USE_LIBCPP) + add_compile_options(-stdlib=libc++) + if (NOT OS_MACOSX) + add_compile_options(-lstdc++) + endif() + add_definitions(-DUSE_LIBCPP) + else() + add_compile_options(-Wno-c++20-attribute-extensions) + endif() endif () # https://github.com/boostorg/uuid/issues/92 diff --git a/be/src/agent/utils.h b/be/src/agent/utils.h index 2785e562e48166..851d045f13a4d6 100644 --- a/be/src/agent/utils.h +++ b/be/src/agent/utils.h @@ -29,7 +29,7 @@ namespace doris { class MasterServerClient { public: MasterServerClient(const TMasterInfo& master_info, FrontendServiceClientCache* client_cache); - virtual ~MasterServerClient() {}; + virtual ~MasterServerClient() = default; // Report finished task to the master server // @@ -59,8 +59,8 @@ class MasterServerClient { class AgentUtils { public: - AgentUtils() {}; - virtual ~AgentUtils() {}; + AgentUtils() = default; + virtual ~AgentUtils() = default; // Execute shell cmd virtual bool exec_cmd(const std::string& command, std::string* errmsg, diff --git a/be/src/common/logging.h b/be/src/common/logging.h index 7c025b7e890c96..d8c55d5f6bfa53 100644 --- a/be/src/common/logging.h +++ b/be/src/common/logging.h @@ -86,7 +86,7 @@ class TaggableLogger { } else { _stream << fmt::format(fmt, std::forward(args)...); } - }; + } template TaggableLogger& tag(std::string_view key, const V& value) { diff --git a/be/src/common/status.h b/be/src/common/status.h index 6381381d375886..71d16a8f1e7773 100644 --- a/be/src/common/status.h +++ b/be/src/common/status.h @@ -253,7 +253,7 @@ E(INVERTED_INDEX_CLUCENE_ERROR, -6002); E(INVERTED_INDEX_FILE_NOT_FOUND, -6003); E(INVERTED_INDEX_FILE_HIT_LIMIT, -6004); #undef E -}; // namespace ErrorCode +} // namespace ErrorCode // clang-format off // whether to capture stacktrace diff --git a/be/src/exec/data_sink.h b/be/src/exec/data_sink.h index f5586783082441..2b1040fa6b4fec 100644 --- a/be/src/exec/data_sink.h +++ b/be/src/exec/data_sink.h @@ -59,7 +59,7 @@ class DataSink { // Send a Block into this sink. virtual Status send(RuntimeState* state, vectorized::Block* block, bool eos = false) { return Status::NotSupported("Not support send block"); - }; + } // Releases all resources that were allocated in prepare()/send(). // Further send() calls are illegal after calling close(). // It must be okay to call this multiple times. Subsequent calls should diff --git a/be/src/exec/olap_common.h b/be/src/exec/olap_common.h index 034696de6e1a33..2980791b6322cf 100644 --- a/be/src/exec/olap_common.h +++ b/be/src/exec/olap_common.h @@ -336,7 +336,7 @@ class ColumnValueRange { set_whole_value_range(); } _contain_null = contain_null; - }; + } int precision() const { return _precision; } diff --git a/be/src/exec/tablet_info.h b/be/src/exec/tablet_info.h index 869db83ec980ae..27abae5b3a0b1e 100644 --- a/be/src/exec/tablet_info.h +++ b/be/src/exec/tablet_info.h @@ -99,7 +99,7 @@ struct VOlapTablePartition { std::vector indexes; VOlapTablePartition(vectorized::Block* partition_block) - : start_key {partition_block, -1}, end_key {partition_block, -1} {}; + : start_key {partition_block, -1}, end_key {partition_block, -1} {} }; class VOlapTablePartKeyComparator { diff --git a/be/src/exprs/bitmapfilter_predicate.h b/be/src/exprs/bitmapfilter_predicate.h index dbc94470345767..b8f5eb8c841cb3 100644 --- a/be/src/exprs/bitmapfilter_predicate.h +++ b/be/src/exprs/bitmapfilter_predicate.h @@ -33,7 +33,7 @@ class BitmapFilterFuncBase { virtual void insert_many(const std::vector bitmaps) = 0; virtual bool empty() = 0; virtual Status assign(BitmapValue* bitmap_value) = 0; - virtual void light_copy(BitmapFilterFuncBase* other) { _not_in = other->_not_in; }; + virtual void light_copy(BitmapFilterFuncBase* other) { _not_in = other->_not_in; } virtual uint16_t find_fixed_len_olap_engine(const char* data, const uint8* nullmap, uint16_t* offsets, int number) = 0; virtual void find_batch(const char* data, const uint8* nullmap, int number, diff --git a/be/src/exprs/create_predicate_function.h b/be/src/exprs/create_predicate_function.h index d02b16398042c2..33efebb3252994 100644 --- a/be/src/exprs/create_predicate_function.h +++ b/be/src/exprs/create_predicate_function.h @@ -33,7 +33,7 @@ class MinmaxFunctionTraits { template static BasePtr get_function() { return new MinMaxNumFunc::CppType>(); - }; + } }; class HybridSetTraits { @@ -45,7 +45,7 @@ class HybridSetTraits { using Set = std::conditional_t, StringSet, HybridSet>; return new Set(); - }; + } }; class BloomFilterTraits { @@ -54,7 +54,7 @@ class BloomFilterTraits { template static BasePtr get_function() { return new BloomFilterFunc(); - }; + } }; class BitmapFilterTraits { @@ -63,7 +63,7 @@ class BitmapFilterTraits { template static BasePtr get_function() { return new BitmapFilterFunc(); - }; + } }; template diff --git a/be/src/geo/geo_types.h b/be/src/geo/geo_types.h index a9a2a81f5cf97b..bbaa3a0cccf660 100644 --- a/be/src/geo/geo_types.h +++ b/be/src/geo/geo_types.h @@ -54,7 +54,7 @@ class GeoShape { virtual std::string as_wkt() const = 0; virtual bool contains(const GeoShape* rhs) const { return false; } - virtual std::string to_string() const { return ""; }; + virtual std::string to_string() const { return ""; } protected: virtual void encode(std::string* buf) = 0; diff --git a/be/src/glibc-compatibility/glibc-compatibility.c b/be/src/glibc-compatibility/glibc-compatibility.c index e3f62b7948ae6a..8377dc45f297ed 100644 --- a/be/src/glibc-compatibility/glibc-compatibility.c +++ b/be/src/glibc-compatibility/glibc-compatibility.c @@ -138,7 +138,7 @@ int __open_2(const char *path, int oflag) /// No-ops. int pthread_setname_np(pthread_t thread, const char *name) { return 0; } -int pthread_getname_np(pthread_t thread, char *name, size_t len) { name[0] = '\0'; return 0; }; +int pthread_getname_np(pthread_t thread, char *name, size_t len) { name[0] = '\0'; return 0; } #define SHMDIR "/dev/shm/" @@ -172,7 +172,7 @@ void __attribute__((__weak__)) explicit_bzero(void * buf, size_t len) void __explicit_bzero_chk(void * buf, size_t len, size_t unused) { - return explicit_bzero(buf, len); + explicit_bzero(buf, len); } diff --git a/be/src/glibc-compatibility/musl/sync_file_range.c b/be/src/glibc-compatibility/musl/sync_file_range.c index 610b11c8c96a50..1bd44ed5b1a363 100644 --- a/be/src/glibc-compatibility/musl/sync_file_range.c +++ b/be/src/glibc-compatibility/musl/sync_file_range.c @@ -18,4 +18,4 @@ int sync_file_range(int fd, off_t pos, off_t len, unsigned flags) #else return __syscall_ret(-ENOSYS); #endif -} \ No newline at end of file +} diff --git a/be/src/glibc-compatibility/musl/x86_64/atomic_arch.h b/be/src/glibc-compatibility/musl/x86_64/atomic_arch.h index cb3bf8da7fd993..0460cc23b40cce 100644 --- a/be/src/glibc-compatibility/musl/x86_64/atomic_arch.h +++ b/be/src/glibc-compatibility/musl/x86_64/atomic_arch.h @@ -93,19 +93,19 @@ static inline void a_store(volatile int *p, int x) } #define a_barrier a_barrier -static inline void a_barrier() +static inline void a_barrier(void) { __asm__ __volatile__( "" : : : "memory" ); } #define a_spin a_spin -static inline void a_spin() +static inline void a_spin(void) { __asm__ __volatile__( "pause" : : : "memory" ); } #define a_crash a_crash -static inline void a_crash() +static inline void a_crash(void) { __asm__ __volatile__( "hlt" : : : "memory" ); } diff --git a/be/src/http/action/health_action.h b/be/src/http/action/health_action.h index c105cb2e77c974..68d46fa325f354 100644 --- a/be/src/http/action/health_action.h +++ b/be/src/http/action/health_action.h @@ -28,7 +28,7 @@ class HealthAction : public HttpHandler { public: HealthAction(); - virtual ~HealthAction() {}; + ~HealthAction() override = default; void handle(HttpRequest* req) override; }; diff --git a/be/src/http/action/stream_load_2pc.h b/be/src/http/action/stream_load_2pc.h index 304e6a902ff43c..1a1013a12bb43b 100644 --- a/be/src/http/action/stream_load_2pc.h +++ b/be/src/http/action/stream_load_2pc.h @@ -29,7 +29,7 @@ class StreamLoad2PCAction : public HttpHandler { public: StreamLoad2PCAction(ExecEnv* exec_env); - virtual ~StreamLoad2PCAction() {}; + ~StreamLoad2PCAction() override = default; void handle(HttpRequest* req) override; std::string get_success_info(const std::string txn_id, const std::string txn_operation); diff --git a/be/src/http/action/version_action.h b/be/src/http/action/version_action.h index 9f6f421c86ab1c..7695ad9fe4d86a 100644 --- a/be/src/http/action/version_action.h +++ b/be/src/http/action/version_action.h @@ -29,7 +29,7 @@ class VersionAction : public HttpHandler { public: VersionAction(); - virtual ~VersionAction() {}; + ~VersionAction() override = default; void handle(HttpRequest* req) override; }; diff --git a/be/src/io/cache/block/block_file_cache_profile.cpp b/be/src/io/cache/block/block_file_cache_profile.cpp index c133fc3b16b0d0..d18a0e180e1c08 100644 --- a/be/src/io/cache/block/block_file_cache_profile.cpp +++ b/be/src/io/cache/block/block_file_cache_profile.cpp @@ -19,8 +19,6 @@ #include -#include "http/http_common.h" - namespace doris { namespace io { @@ -106,10 +104,10 @@ void FileCacheProfile::update(int64_t table_id, int64_t partition_id, OlapReader } count = _profile[table_id][partition_id]; } - if (partition_metric) [[unlikely]] { + if (partition_metric) { partition_metric->register_entity(); } - if (table_metric) [[unlikely]] { + if (table_metric) { table_metric->register_entity(); } count->num_io_total.fetch_add(stats->file_cache_stats.num_io_total, std::memory_order_relaxed); diff --git a/be/src/io/cache/dummy_file_cache.h b/be/src/io/cache/dummy_file_cache.h index aafce20fefbc4d..7af74511308286 100644 --- a/be/src/io/cache/dummy_file_cache.h +++ b/be/src/io/cache/dummy_file_cache.h @@ -65,7 +65,7 @@ class DummyFileCache final : public FileCache { int64_t get_oldest_match_time() const override { return _gc_lru_queue.empty() ? 0 : _gc_lru_queue.top().last_match_time; - }; + } bool is_gc_finish() const override { return _gc_lru_queue.empty(); } diff --git a/be/src/io/cache/file_cache.h b/be/src/io/cache/file_cache.h index 89950b2ba823d7..692cd00e167365 100644 --- a/be/src/io/cache/file_cache.h +++ b/be/src/io/cache/file_cache.h @@ -77,7 +77,7 @@ class FileCache : public FileReader { struct SubFileLRUComparator { bool operator()(const T& lhs, const T& rhs) const { return lhs.last_match_time > rhs.last_match_time; - }; + } }; size_t _cache_file_size; diff --git a/be/src/io/cache/sub_file_cache.h b/be/src/io/cache/sub_file_cache.h index dab350b6ce80e6..28dfd99dddb75b 100644 --- a/be/src/io/cache/sub_file_cache.h +++ b/be/src/io/cache/sub_file_cache.h @@ -57,7 +57,7 @@ class SubFileCache final : public FileCache { int64_t get_oldest_match_time() const override { return _gc_lru_queue.empty() ? 0 : _gc_lru_queue.top().last_match_time; - }; + } bool is_gc_finish() const override { return _gc_lru_queue.empty(); } diff --git a/be/src/io/fs/s3_file_system.h b/be/src/io/fs/s3_file_system.h index 70940cb7d0512e..8469ddf24e1402 100644 --- a/be/src/io/fs/s3_file_system.h +++ b/be/src/io/fs/s3_file_system.h @@ -68,7 +68,7 @@ class S3FileSystem final : public RemoteFileSystem { std::shared_ptr get_client() const { std::lock_guard lock(_client_mu); return _client; - }; + } // Guarded by external lock. void set_conf(S3Conf s3_conf) { _s3_conf = std::move(s3_conf); } diff --git a/be/src/io/hdfs_builder.h b/be/src/io/hdfs_builder.h index a8feb0ffa12092..400bb354e68e2e 100644 --- a/be/src/io/hdfs_builder.h +++ b/be/src/io/hdfs_builder.h @@ -36,11 +36,11 @@ class HDFSCommonBuilder { const std::map& properties); public: - HDFSCommonBuilder() : hdfs_builder(hdfsNewBuilder()) {}; - ~HDFSCommonBuilder() { hdfsFreeBuilder(hdfs_builder); }; + HDFSCommonBuilder() : hdfs_builder(hdfsNewBuilder()) {} + ~HDFSCommonBuilder() { hdfsFreeBuilder(hdfs_builder); } - hdfsBuilder* get() { return hdfs_builder; }; - bool is_need_kinit() { return need_kinit; }; + hdfsBuilder* get() { return hdfs_builder; } + bool is_need_kinit() const { return need_kinit; } Status run_kinit(); private: diff --git a/be/src/olap/block_column_predicate.h b/be/src/olap/block_column_predicate.h index 62809ceb09b902..d0c5c2801b871e 100644 --- a/be/src/olap/block_column_predicate.h +++ b/be/src/olap/block_column_predicate.h @@ -47,32 +47,32 @@ class BlockColumnPredicate { return selected_size; } virtual void evaluate_and(vectorized::MutableColumns& block, uint16_t* sel, - uint16_t selected_size, bool* flags) const {}; + uint16_t selected_size, bool* flags) const {} virtual void evaluate_or(vectorized::MutableColumns& block, uint16_t* sel, - uint16_t selected_size, bool* flags) const {}; + uint16_t selected_size, bool* flags) const {} - virtual void evaluate_vec(vectorized::MutableColumns& block, uint16_t size, - bool* flags) const {}; + virtual void evaluate_vec(vectorized::MutableColumns& block, uint16_t size, bool* flags) const { + } virtual bool evaluate_and(const std::pair& statistic) const { LOG(FATAL) << "should not reach here"; return true; - }; + } virtual bool evaluate_and(const segment_v2::BloomFilter* bf) const { LOG(FATAL) << "should not reach here"; return true; - }; + } virtual bool can_do_bloom_filter() const { return false; } }; class SingleColumnBlockPredicate : public BlockColumnPredicate { public: - explicit SingleColumnBlockPredicate(const ColumnPredicate* pre) : _predicate(pre) {}; + explicit SingleColumnBlockPredicate(const ColumnPredicate* pre) : _predicate(pre) {} void get_all_column_ids(std::set& column_id_set) const override { column_id_set.insert(_predicate->column_id()); - }; + } void get_all_column_predicate(std::set& predicate_set) const override { predicate_set.insert(_predicate); @@ -115,7 +115,7 @@ class MutilColumnBlockPredicate : public BlockColumnPredicate { for (auto child_block_predicate : _block_column_predicate_vec) { child_block_predicate->get_all_column_ids(column_id_set); } - }; + } void get_all_column_predicate(std::set& predicate_set) const override { for (auto child_block_predicate : _block_column_predicate_vec) { diff --git a/be/src/olap/column_predicate.h b/be/src/olap/column_predicate.h index e95a444e24a7ed..2af921ddf408d1 100644 --- a/be/src/olap/column_predicate.h +++ b/be/src/olap/column_predicate.h @@ -143,11 +143,11 @@ class ColumnPredicate { virtual uint16_t evaluate(const vectorized::IColumn& column, uint16_t* sel, uint16_t size) const { return size; - }; + } virtual void evaluate_and(const vectorized::IColumn& column, const uint16_t* sel, uint16_t size, - bool* flags) const {}; + bool* flags) const {} virtual void evaluate_or(const vectorized::IColumn& column, const uint16_t* sel, uint16_t size, - bool* flags) const {}; + bool* flags) const {} virtual bool evaluate_and(const std::pair& statistic) const { return true; diff --git a/be/src/olap/field.h b/be/src/olap/field.h index dc527720f74741..2db058d14a3b0f 100644 --- a/be/src/olap/field.h +++ b/be/src/olap/field.h @@ -78,7 +78,7 @@ class Field { virtual size_t get_variable_len() const { return 0; } - virtual void modify_zone_map_index(char*) const {}; + virtual void modify_zone_map_index(char*) const {} virtual Field* clone() const { auto* local = new Field(); diff --git a/be/src/olap/memtable.h b/be/src/olap/memtable.h index b3b90265665c11..62f211e12a005a 100644 --- a/be/src/olap/memtable.h +++ b/be/src/olap/memtable.h @@ -75,7 +75,7 @@ class MemTable { char* _agg_mem; size_t* _agg_state_offset; - RowInBlock(size_t row) : _row_pos(row) {}; + RowInBlock(size_t row) : _row_pos(row) {} void init_agg_places(char* agg_mem, size_t* agg_state_offset) { _agg_mem = agg_mem; @@ -87,7 +87,7 @@ class MemTable { class RowInBlockComparator { public: - RowInBlockComparator(const Schema* schema) : _schema(schema) {}; + RowInBlockComparator(const Schema* schema) : _schema(schema) {} // call set_block before operator(). // only first time insert block to create _input_mutable_block, // so can not Comparator of construct to set pblock diff --git a/be/src/olap/predicate_creator.h b/be/src/olap/predicate_creator.h index 35970de723c61c..cc22ba7a62c7f4 100644 --- a/be/src/olap/predicate_creator.h +++ b/be/src/olap/predicate_creator.h @@ -135,7 +135,7 @@ struct CustomPredicateCreator : public PredicateCreator { public: using CppType = typename PredicatePrimitiveTypeTraits::PredicateFieldType; CustomPredicateCreator(const std::function& convert) - : _convert(convert) {}; + : _convert(convert) {} ColumnPredicate* create(const TabletColumn& column, int index, const ConditionType& conditions, bool opposite, MemPool* pool) override { diff --git a/be/src/olap/rowset/beta_rowset.h b/be/src/olap/rowset/beta_rowset.h index 5c9137e1e95a90..af3bbd08c92ede 100644 --- a/be/src/olap/rowset/beta_rowset.h +++ b/be/src/olap/rowset/beta_rowset.h @@ -77,7 +77,7 @@ class BetaRowset : public Rowset { // only applicable to alpha rowset, no op here Status remove_old_files(std::vector* files_to_remove) override { return Status::OK(); - }; + } bool check_path(const std::string& path) override; diff --git a/be/src/olap/rowset/segment_v2/binary_plain_page.h b/be/src/olap/rowset/segment_v2/binary_plain_page.h index bb01b1fdb074b2..a252a5d8b518ba 100644 --- a/be/src/olap/rowset/segment_v2/binary_plain_page.h +++ b/be/src/olap/rowset/segment_v2/binary_plain_page.h @@ -238,7 +238,7 @@ class BinaryPlainPageDecoder : public PageDecoder { *n = max_fetch; return Status::OK(); - }; + } Status read_by_rowids(const rowid_t* rowids, ordinal_t page_first_ordinal, size_t* n, vectorized::MutableColumnPtr& dst) override { diff --git a/be/src/olap/rowset/segment_v2/bitshuffle_page.h b/be/src/olap/rowset/segment_v2/bitshuffle_page.h index 73b6c8d40c00ec..c5c2d235ed66e0 100644 --- a/be/src/olap/rowset/segment_v2/bitshuffle_page.h +++ b/be/src/olap/rowset/segment_v2/bitshuffle_page.h @@ -380,11 +380,11 @@ class BitShufflePageDecoder : public PageDecoder { } return Status::OK(); - }; + } Status next_batch(size_t* n, vectorized::MutableColumnPtr& dst) override { return next_batch<>(n, dst); - }; + } Status read_by_rowids(const rowid_t* rowids, ordinal_t page_first_ordinal, size_t* n, vectorized::MutableColumnPtr& dst) override { diff --git a/be/src/olap/rowset/segment_v2/encoding_info.h b/be/src/olap/rowset/segment_v2/encoding_info.h index 3f5153303ede21..7783862462ce0d 100644 --- a/be/src/olap/rowset/segment_v2/encoding_info.h +++ b/be/src/olap/rowset/segment_v2/encoding_info.h @@ -62,7 +62,7 @@ class EncodingInfo { FieldType type() const { return _type; } EncodingTypePB encoding() const { return _encoding; } - DataPagePreDecoder* get_data_page_pre_decoder() const { return _data_page_pre_decoder.get(); }; + DataPagePreDecoder* get_data_page_pre_decoder() const { return _data_page_pre_decoder.get(); } private: friend class EncodingInfoResolver; diff --git a/be/src/olap/rowset/segment_v2/frame_of_reference_page.h b/be/src/olap/rowset/segment_v2/frame_of_reference_page.h index ef72fa5a638caf..ad1e0bc5410735 100644 --- a/be/src/olap/rowset/segment_v2/frame_of_reference_page.h +++ b/be/src/olap/rowset/segment_v2/frame_of_reference_page.h @@ -143,7 +143,7 @@ class FrameOfReferencePageDecoder : public PageDecoder { Status next_batch(size_t* n, vectorized::MutableColumnPtr& dst) override { return Status::NotSupported("frame page not implement vec op now"); - }; + } Status peek_next_batch(size_t* n, vectorized::MutableColumnPtr& dst) override { return Status::NotSupported("frame page not implement vec op now"); diff --git a/be/src/olap/rowset/segment_v2/indexed_column_reader.h b/be/src/olap/rowset/segment_v2/indexed_column_reader.h index 7e695616a727c6..79de411d6c77e9 100644 --- a/be/src/olap/rowset/segment_v2/indexed_column_reader.h +++ b/be/src/olap/rowset/segment_v2/indexed_column_reader.h @@ -47,7 +47,7 @@ class IndexedColumnIterator; class IndexedColumnReader { public: explicit IndexedColumnReader(io::FileReaderSPtr file_reader, const IndexedColumnMetaPB& meta) - : _file_reader(std::move(file_reader)), _meta(meta) {}; + : _file_reader(std::move(file_reader)), _meta(meta) {} Status load(bool use_page_cache, bool kept_in_memory); diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h index 4330ef37687c1f..1fbdc9d592abb9 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h +++ b/be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h @@ -127,7 +127,7 @@ class DorisCompoundDirectory::FSIndexInput : public lucene::store::BufferedIndex FSIndexInput(SharedHandle* handle, int32_t buffer_size) : BufferedIndexInput(buffer_size) { this->_pos = 0; this->_handle = handle; - }; + } protected: FSIndexInput(const FSIndexInput& clone); diff --git a/be/src/olap/rowset/segment_v2/inverted_index_reader.h b/be/src/olap/rowset/segment_v2/inverted_index_reader.h index 5ff1d22222b709..1d0bfb501588b2 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_reader.h +++ b/be/src/olap/rowset/segment_v2/inverted_index_reader.h @@ -65,7 +65,7 @@ class InvertedIndexReader { public: explicit InvertedIndexReader(io::FileSystemSPtr fs, const std::string& path, const uint32_t index_id) - : _fs(std::move(fs)), _path(path), _index_id(index_id) {}; + : _fs(std::move(fs)), _path(path), _index_id(index_id) {} virtual ~InvertedIndexReader() = default; // create a new column iterator. Client should delete returned iterator @@ -95,7 +95,7 @@ class FullTextIndexReader : public InvertedIndexReader { public: explicit FullTextIndexReader(io::FileSystemSPtr fs, const std::string& path, const int64_t uniq_id) - : InvertedIndexReader(std::move(fs), path, uniq_id) {}; + : InvertedIndexReader(std::move(fs), path, uniq_id) {} ~FullTextIndexReader() override = default; Status new_iterator(const TabletIndex* index_meta, InvertedIndexIterator** iterator) override; @@ -119,7 +119,7 @@ class StringTypeInvertedIndexReader : public InvertedIndexReader { public: explicit StringTypeInvertedIndexReader(io::FileSystemSPtr fs, const std::string& path, const int64_t uniq_id) - : InvertedIndexReader(std::move(fs), path, uniq_id) {}; + : InvertedIndexReader(std::move(fs), path, uniq_id) {} ~StringTypeInvertedIndexReader() override = default; Status new_iterator(const TabletIndex* index_meta, InvertedIndexIterator** iterator) override; @@ -151,8 +151,8 @@ class InvertedIndexVisitor : public lucene::util::bkd::bkd_reader::intersect_vis bool only_count = false); virtual ~InvertedIndexVisitor() = default; - void set_reader(lucene::util::bkd::bkd_reader* r) { reader = r; }; - lucene::util::bkd::bkd_reader* get_reader() { return reader; }; + void set_reader(lucene::util::bkd::bkd_reader* r) { reader = r; } + lucene::util::bkd::bkd_reader* get_reader() { return reader; } void visit(int rowID) override; void visit(roaring::Roaring& r) override; diff --git a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp index 9a9fc3a4415183..b4be3a8bb41f15 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp @@ -69,7 +69,7 @@ class InvertedIndexColumnWriterImpl : public InvertedIndexColumnWriter { get_parser_string_from_properties(_index_meta->properties())); _value_key_coder = get_key_coder(field_type); _field_name = std::wstring(field_name.begin(), field_name.end()); - }; + } ~InvertedIndexColumnWriterImpl() override = default; @@ -116,7 +116,7 @@ class InvertedIndexColumnWriterImpl : public InvertedIndexColumnWriter { _CLDELETE(_char_string_reader) _char_string_reader = nullptr; } - }; + } Status init_bkd_index() { size_t value_length = sizeof(CppType); diff --git a/be/src/olap/rowset/segment_v2/ordinal_page_index.h b/be/src/olap/rowset/segment_v2/ordinal_page_index.h index 76df60fe2fc9b3..f24cd6e1037a8e 100644 --- a/be/src/olap/rowset/segment_v2/ordinal_page_index.h +++ b/be/src/olap/rowset/segment_v2/ordinal_page_index.h @@ -115,8 +115,8 @@ class OrdinalPageIndexIterator { DCHECK_LT(_cur_idx, _index->_num_pages); _cur_idx++; } - int32_t page_index() const { return _cur_idx; }; - const PagePointer& page() const { return _index->_pages[_cur_idx]; }; + int32_t page_index() const { return _cur_idx; } + const PagePointer& page() const { return _index->_pages[_cur_idx]; } ordinal_t first_ordinal() const { return _index->get_first_ordinal(_cur_idx); } ordinal_t last_ordinal() const { return _index->get_last_ordinal(_cur_idx); } diff --git a/be/src/olap/rowset/segment_v2/plain_page.h b/be/src/olap/rowset/segment_v2/plain_page.h index 1f22e1e8c19c4c..bd2e9747097054 100644 --- a/be/src/olap/rowset/segment_v2/plain_page.h +++ b/be/src/olap/rowset/segment_v2/plain_page.h @@ -183,7 +183,7 @@ class PlainPageDecoder : public PageDecoder { Status next_batch(size_t* n, vectorized::MutableColumnPtr& dst) override { return Status::NotSupported("plain page not implement vec op now"); - }; + } size_t count() const override { DCHECK(_parsed); diff --git a/be/src/olap/rowset/segment_v2/rle_page.h b/be/src/olap/rowset/segment_v2/rle_page.h index 7f6ec2b0370b9a..991a18aee083f9 100644 --- a/be/src/olap/rowset/segment_v2/rle_page.h +++ b/be/src/olap/rowset/segment_v2/rle_page.h @@ -229,7 +229,7 @@ class RlePageDecoder : public PageDecoder { _cur_index += to_fetch; *n = to_fetch; return Status::OK(); - }; + } Status read_by_rowids(const rowid_t* rowids, ordinal_t page_first_ordinal, size_t* n, vectorized::MutableColumnPtr& dst) override { diff --git a/be/src/olap/rowset/segment_v2/segment.h b/be/src/olap/rowset/segment_v2/segment.h index f99ebade281d11..ba111def1f90e6 100644 --- a/be/src/olap/rowset/segment_v2/segment.h +++ b/be/src/olap/rowset/segment_v2/segment.h @@ -105,11 +105,11 @@ class Segment : public std::enable_shared_from_this { std::string min_key() { DCHECK(_tablet_schema->keys_type() == UNIQUE_KEYS && _footer.has_primary_key_index_meta()); return _footer.primary_key_index_meta().min_key(); - }; + } std::string max_key() { DCHECK(_tablet_schema->keys_type() == UNIQUE_KEYS && _footer.has_primary_key_index_meta()); return _footer.primary_key_index_meta().max_key(); - }; + } io::FileReaderSPtr file_reader() { return _file_reader; } diff --git a/be/src/olap/rowset/unique_rowset_id_generator.h b/be/src/olap/rowset/unique_rowset_id_generator.h index 22909bc1133795..ef8d4cfde20b03 100644 --- a/be/src/olap/rowset/unique_rowset_id_generator.h +++ b/be/src/olap/rowset/unique_rowset_id_generator.h @@ -28,7 +28,10 @@ namespace doris { class UniqueRowsetIdGenerator : public RowsetIdGenerator { public: UniqueRowsetIdGenerator(const UniqueId& backend_uid); - ~UniqueRowsetIdGenerator(); + ~UniqueRowsetIdGenerator() override; + + UniqueRowsetIdGenerator(const UniqueRowsetIdGenerator&) = delete; + UniqueRowsetIdGenerator& operator=(const UniqueRowsetIdGenerator&) = delete; RowsetId next_id() override; @@ -48,8 +51,6 @@ class UniqueRowsetIdGenerator : public RowsetIdGenerator { // to determine whether the rowset id is being used. // But to use id_in_use() and release_id() to check it. std::unordered_set _valid_rowset_id_hi; - - DISALLOW_COPY_AND_ASSIGN(UniqueRowsetIdGenerator); }; // UniqueRowsetIdGenerator } // namespace doris diff --git a/be/src/olap/schema.h b/be/src/olap/schema.h index 56bc1ecff3b049..bbe912718f3156 100644 --- a/be/src/olap/schema.h +++ b/be/src/olap/schema.h @@ -152,7 +152,7 @@ class Schema { int32_t unique_id(size_t index) const { return _unique_ids[index]; } int32_t delete_sign_idx() const { return _delete_sign_idx; } bool has_sequence_col() const { return _has_sequence_col; } - int32_t rowid_col_idx() const { return _rowid_col_idx; }; + int32_t rowid_col_idx() const { return _rowid_col_idx; } private: void _init(const std::vector& cols, const std::vector& col_ids, diff --git a/be/src/olap/schema_change.h b/be/src/olap/schema_change.h index 40e4b022706996..099d1af81da7b2 100644 --- a/be/src/olap/schema_change.h +++ b/be/src/olap/schema_change.h @@ -101,7 +101,7 @@ class SchemaChange { virtual Status _inner_process(RowsetReaderSharedPtr rowset_reader, RowsetWriter* rowset_writer, TabletSharedPtr new_tablet, TabletSchemaSPtr base_tablet_schema) { return Status::NotSupported("inner process unsupported."); - }; + } bool _check_row_nums(RowsetReaderSharedPtr reader, const RowsetWriter& writer) const { if (reader->rowset()->num_rows() != writer.num_rows() + _merged_rows + _filtered_rows) { diff --git a/be/src/olap/storage_engine.h b/be/src/olap/storage_engine.h index 295473576ad3ed..6ccd446faee79a 100644 --- a/be/src/olap/storage_engine.h +++ b/be/src/olap/storage_engine.h @@ -140,7 +140,7 @@ class StorageEngine { bool check_rowset_id_in_unused_rowsets(const RowsetId& rowset_id); - RowsetId next_rowset_id() { return _rowset_id_generator->next_id(); }; + RowsetId next_rowset_id() { return _rowset_id_generator->next_id(); } bool rowset_id_in_use(const RowsetId& rowset_id) { return _rowset_id_generator->id_in_use(rowset_id); diff --git a/be/src/olap/tablet_schema.h b/be/src/olap/tablet_schema.h index 8f9a21ee9a8d35..2cc6860266d655 100644 --- a/be/src/olap/tablet_schema.h +++ b/be/src/olap/tablet_schema.h @@ -177,7 +177,7 @@ class TabletSchema { void add_row_column(); void copy_from(const TabletSchema& tablet_schema); std::string to_key() const; - int64_t mem_size() const { return _mem_size; }; + int64_t mem_size() const { return _mem_size; } size_t row_size() const; int32_t field_index(const std::string& field_name) const; diff --git a/be/src/olap/utils.h b/be/src/olap/utils.h index fdf6a7564bfdaa..883964a4dc9e0c 100644 --- a/be/src/olap/utils.h +++ b/be/src/olap/utils.h @@ -279,7 +279,7 @@ struct RowLocation { struct GlobalRowLoacation { GlobalRowLoacation(uint32_t tid, RowsetId rsid, uint32_t sid, uint32_t rid) - : tablet_id(tid), row_location(rsid, sid, rid) {}; + : tablet_id(tid), row_location(rsid, sid, rid) {} uint32_t tablet_id; RowLocation row_location; }; diff --git a/be/src/pipeline/exec/aggregation_sink_operator.h b/be/src/pipeline/exec/aggregation_sink_operator.h index cc48337c25ab3a..23115fbe190d8d 100644 --- a/be/src/pipeline/exec/aggregation_sink_operator.h +++ b/be/src/pipeline/exec/aggregation_sink_operator.h @@ -33,13 +33,13 @@ class AggSinkOperatorBuilder final : public OperatorBuilder { public: AggSinkOperator(OperatorBuilderBase* operator_builder, ExecNode* node); - bool can_write() override { return true; }; + bool can_write() override { return true; } }; } // namespace pipeline diff --git a/be/src/pipeline/exec/analytic_sink_operator.h b/be/src/pipeline/exec/analytic_sink_operator.h index c786ffb9d71dfb..793824ea753efb 100644 --- a/be/src/pipeline/exec/analytic_sink_operator.h +++ b/be/src/pipeline/exec/analytic_sink_operator.h @@ -33,14 +33,14 @@ class AnalyticSinkOperatorBuilder final : public OperatorBuilder { public: AnalyticSinkOperator(OperatorBuilderBase* operator_builder, ExecNode* node); - bool can_write() override { return _node->can_write(); }; + bool can_write() override { return _node->can_write(); } }; } // namespace pipeline diff --git a/be/src/pipeline/exec/assert_num_rows_operator.h b/be/src/pipeline/exec/assert_num_rows_operator.h index a3f9702dd613b8..7f1371e521db24 100644 --- a/be/src/pipeline/exec/assert_num_rows_operator.h +++ b/be/src/pipeline/exec/assert_num_rows_operator.h @@ -27,7 +27,7 @@ namespace pipeline { class AssertNumRowsOperatorBuilder final : public OperatorBuilder { public: AssertNumRowsOperatorBuilder(int32_t id, ExecNode* node) - : OperatorBuilder(id, "AssertNumRowsOperator", node) {}; + : OperatorBuilder(id, "AssertNumRowsOperator", node) {} OperatorPtr build_operator() override; }; @@ -35,7 +35,7 @@ class AssertNumRowsOperatorBuilder final : public OperatorBuilder { public: AssertNumRowsOperator(OperatorBuilderBase* operator_builder, ExecNode* node) - : StreamingOperator(operator_builder, node) {}; + : StreamingOperator(operator_builder, node) {} }; OperatorPtr AssertNumRowsOperatorBuilder::build_operator() { diff --git a/be/src/pipeline/exec/const_value_operator.h b/be/src/pipeline/exec/const_value_operator.h index 567501ccf5843e..120c6753ee8372 100644 --- a/be/src/pipeline/exec/const_value_operator.h +++ b/be/src/pipeline/exec/const_value_operator.h @@ -29,7 +29,7 @@ namespace pipeline { class ConstValueOperatorBuilder final : public OperatorBuilder { public: ConstValueOperatorBuilder(int32_t id, ExecNode* node) - : OperatorBuilder(id, "ConstValueOperator", node) {}; + : OperatorBuilder(id, "ConstValueOperator", node) {} OperatorPtr build_operator() override; @@ -39,9 +39,9 @@ class ConstValueOperatorBuilder final : public OperatorBuilder { public: ConstValueOperator(OperatorBuilderBase* operator_builder, ExecNode* node) - : SourceOperator(operator_builder, node) {}; + : SourceOperator(operator_builder, node) {} - bool can_read() override { return true; }; + bool can_read() override { return true; } }; OperatorPtr ConstValueOperatorBuilder::build_operator() { diff --git a/be/src/pipeline/exec/datagen_operator.h b/be/src/pipeline/exec/datagen_operator.h index 27933caf26bb53..7cea4d54df43f5 100644 --- a/be/src/pipeline/exec/datagen_operator.h +++ b/be/src/pipeline/exec/datagen_operator.h @@ -36,7 +36,7 @@ class DataGenOperator : public SourceOperator { public: DataGenOperator(OperatorBuilderBase* operator_builder, ExecNode* datagen_node); - bool can_read() override { return true; }; + bool can_read() override { return true; } Status open(RuntimeState* state) override; diff --git a/be/src/pipeline/exec/empty_set_operator.h b/be/src/pipeline/exec/empty_set_operator.h index f0dc39e1fdbfc1..a6324ca249e3cc 100644 --- a/be/src/pipeline/exec/empty_set_operator.h +++ b/be/src/pipeline/exec/empty_set_operator.h @@ -36,7 +36,7 @@ class EmptySetSourceOperatorBuilder final : public OperatorBuilder { public: EmptySetSourceOperator(OperatorBuilderBase* operator_builder, ExecNode* empty_set_node); - bool can_read() override { return true; }; + bool can_read() override { return true; } }; } // namespace pipeline diff --git a/be/src/pipeline/exec/hashjoin_build_sink.h b/be/src/pipeline/exec/hashjoin_build_sink.h index d41f9df1034741..71579c2488d061 100644 --- a/be/src/pipeline/exec/hashjoin_build_sink.h +++ b/be/src/pipeline/exec/hashjoin_build_sink.h @@ -33,13 +33,13 @@ class HashJoinBuildSinkBuilder final : public OperatorBuilder { public: HashJoinBuildSink(OperatorBuilderBase* operator_builder, ExecNode* node); - bool can_write() override { return _node->can_sink_write(); }; + bool can_write() override { return _node->can_sink_write(); } }; } // namespace pipeline diff --git a/be/src/pipeline/exec/mysql_scan_operator.h b/be/src/pipeline/exec/mysql_scan_operator.h index 6ff5b5217e9555..3c5714a7f4ee86 100644 --- a/be/src/pipeline/exec/mysql_scan_operator.h +++ b/be/src/pipeline/exec/mysql_scan_operator.h @@ -33,7 +33,7 @@ class MysqlScanOperator : public SourceOperator { public: MysqlScanOperator(OperatorBuilderBase* operator_builder, ExecNode* mysql_scan_node); - bool can_read() override { return true; }; + bool can_read() override { return true; } Status open(RuntimeState* state) override; diff --git a/be/src/pipeline/exec/nested_loop_join_build_operator.h b/be/src/pipeline/exec/nested_loop_join_build_operator.h index e5c9f3f4991950..32bd55d8cf4337 100644 --- a/be/src/pipeline/exec/nested_loop_join_build_operator.h +++ b/be/src/pipeline/exec/nested_loop_join_build_operator.h @@ -34,13 +34,13 @@ class NestLoopJoinBuildOperatorBuilder final NestLoopJoinBuildOperatorBuilder(int32_t, ExecNode*); OperatorPtr build_operator() override; - bool is_sink() const override { return true; }; + bool is_sink() const override { return true; } }; class NestLoopJoinBuildOperator final : public StreamingOperator { public: NestLoopJoinBuildOperator(OperatorBuilderBase* operator_builder, ExecNode* node); - bool can_write() override { return true; }; + bool can_write() override { return true; } }; } // namespace pipeline diff --git a/be/src/pipeline/exec/olap_table_sink_operator.h b/be/src/pipeline/exec/olap_table_sink_operator.h index b26d167eca6301..34c276be3afa98 100644 --- a/be/src/pipeline/exec/olap_table_sink_operator.h +++ b/be/src/pipeline/exec/olap_table_sink_operator.h @@ -28,7 +28,7 @@ class OlapTableSinkOperatorBuilder final : public DataSinkOperatorBuilder { public: OlapTableSinkOperatorBuilder(int32_t id, DataSink* sink) - : DataSinkOperatorBuilder(id, "OlapTableSinkOperator", sink) {}; + : DataSinkOperatorBuilder(id, "OlapTableSinkOperator", sink) {} OperatorPtr build_operator() override; }; @@ -36,7 +36,7 @@ class OlapTableSinkOperatorBuilder final class OlapTableSinkOperator final : public DataSinkOperator { public: OlapTableSinkOperator(OperatorBuilderBase* operator_builder, DataSink* sink) - : DataSinkOperator(operator_builder, sink) {}; + : DataSinkOperator(operator_builder, sink) {} bool can_write() override { return true; } // TODO: need use mem_limit }; diff --git a/be/src/pipeline/exec/operator.h b/be/src/pipeline/exec/operator.h index 7eceacae7de611..e23bb78e63563b 100644 --- a/be/src/pipeline/exec/operator.h +++ b/be/src/pipeline/exec/operator.h @@ -140,13 +140,13 @@ class OperatorBase { explicit OperatorBase(OperatorBuilderBase* operator_builder); virtual ~OperatorBase() = default; - virtual std::string get_name() const { return _operator_builder->get_name(); }; + virtual std::string get_name() const { return _operator_builder->get_name(); } bool is_sink() const; bool is_source() const; - virtual Status init(const TDataSink& tsink) { return Status::OK(); }; + virtual Status init(const TDataSink& tsink) { return Status::OK(); } // Prepare for running. (e.g. resource allocation, etc.) virtual Status prepare(RuntimeState* state) = 0; @@ -189,7 +189,7 @@ class OperatorBase { virtual Status get_block(RuntimeState* runtime_state, vectorized::Block* block, SourceState& result_state) { return Status::OK(); - }; + } /** * Push data to the sink operator. @@ -253,7 +253,7 @@ class DataSinkOperator : public OperatorBase { std::remove_pointer_t().exec_node())>; DataSinkOperator(OperatorBuilderBase* builder, DataSink* sink) - : OperatorBase(builder), _sink(reinterpret_cast(sink)) {}; + : OperatorBase(builder), _sink(reinterpret_cast(sink)) {} ~DataSinkOperator() override = default; @@ -312,7 +312,7 @@ class StreamingOperator : public OperatorBase { std::remove_pointer_t().exec_node())>; StreamingOperator(OperatorBuilderBase* builder, ExecNode* node) - : OperatorBase(builder), _node(reinterpret_cast(node)) {}; + : OperatorBase(builder), _node(reinterpret_cast(node)) {} ~StreamingOperator() override = default; @@ -384,7 +384,7 @@ class SourceOperator : public StreamingOperator { std::remove_pointer_t().exec_node())>; SourceOperator(OperatorBuilderBase* builder, ExecNode* node) - : StreamingOperator(builder, node) {}; + : StreamingOperator(builder, node) {} ~SourceOperator() override = default; @@ -419,7 +419,7 @@ class StatefulOperator : public StreamingOperator { StatefulOperator(OperatorBuilderBase* builder, ExecNode* node) : StreamingOperator(builder, node), _child_block(new vectorized::Block), - _child_source_state(SourceState::DEPEND_ON_SOURCE) {}; + _child_source_state(SourceState::DEPEND_ON_SOURCE) {} virtual ~StatefulOperator() = default; diff --git a/be/src/pipeline/exec/set_source_operator.h b/be/src/pipeline/exec/set_source_operator.h index 99ea8e5242744c..14de0079faf39d 100644 --- a/be/src/pipeline/exec/set_source_operator.h +++ b/be/src/pipeline/exec/set_source_operator.h @@ -48,7 +48,7 @@ class SetSourceOperator : public SourceOperator* set_node); - Status open(RuntimeState* /*state*/) override { return Status::OK(); }; + Status open(RuntimeState* /*state*/) override { return Status::OK(); } }; } // namespace pipeline diff --git a/be/src/pipeline/exec/sort_sink_operator.h b/be/src/pipeline/exec/sort_sink_operator.h index aa317e12e95617..c9fc6b52555d3e 100644 --- a/be/src/pipeline/exec/sort_sink_operator.h +++ b/be/src/pipeline/exec/sort_sink_operator.h @@ -40,7 +40,7 @@ class SortSinkOperator final : public StreamingOperator public: SortSinkOperator(OperatorBuilderBase* operator_builder, ExecNode* sort_node); - bool can_write() override { return true; }; + bool can_write() override { return true; } }; } // namespace pipeline diff --git a/be/src/pipeline/exec/streaming_aggregation_sink_operator.h b/be/src/pipeline/exec/streaming_aggregation_sink_operator.h index 55c7c33db6944f..3d47f7fb372880 100644 --- a/be/src/pipeline/exec/streaming_aggregation_sink_operator.h +++ b/be/src/pipeline/exec/streaming_aggregation_sink_operator.h @@ -35,8 +35,8 @@ class StreamingAggSinkOperatorBuilder final : public OperatorBuilder _data_queue; diff --git a/be/src/pipeline/exec/table_sink_operator.h b/be/src/pipeline/exec/table_sink_operator.h index 2e7b13033c0317..cbad6d64728e31 100644 --- a/be/src/pipeline/exec/table_sink_operator.h +++ b/be/src/pipeline/exec/table_sink_operator.h @@ -28,7 +28,7 @@ namespace pipeline { class TableSinkOperatorBuilder final : public DataSinkOperatorBuilder { public: TableSinkOperatorBuilder(int32_t id, DataSink* sink) - : DataSinkOperatorBuilder(id, "TableSinkOperator", sink) {}; + : DataSinkOperatorBuilder(id, "TableSinkOperator", sink) {} OperatorPtr build_operator() override; }; @@ -36,7 +36,7 @@ class TableSinkOperatorBuilder final : public DataSinkOperatorBuilder { public: TableSinkOperator(OperatorBuilderBase* operator_builder, DataSink* sink) - : DataSinkOperator(operator_builder, sink) {}; + : DataSinkOperator(operator_builder, sink) {} bool can_write() override { return true; } }; diff --git a/be/src/pipeline/exec/union_sink_operator.h b/be/src/pipeline/exec/union_sink_operator.h index 7bad62a4c6352e..707a980cf4b02b 100644 --- a/be/src/pipeline/exec/union_sink_operator.h +++ b/be/src/pipeline/exec/union_sink_operator.h @@ -35,7 +35,7 @@ class UnionSinkOperatorBuilder final : public OperatorBuilder queue); - bool can_write() override { return true; }; + bool can_write() override { return true; } Status sink(RuntimeState* state, vectorized::Block* in_block, SourceState source_state) override; diff --git a/be/src/runtime/datetime_value.h b/be/src/runtime/datetime_value.h index 856bd3f854bfed..1e3ee94c596d6a 100644 --- a/be/src/runtime/datetime_value.h +++ b/be/src/runtime/datetime_value.h @@ -367,7 +367,7 @@ class DateTimeValue { } set_time(year, month, day, hour, minute, second, microsecond); return true; - }; + } uint64_t daynr() const { return calc_daynr(_year, _month, _day); } diff --git a/be/src/runtime/memory/mem_tracker_limiter.h b/be/src/runtime/memory/mem_tracker_limiter.h index 2e059f877074b2..3a383cf5730330 100644 --- a/be/src/runtime/memory/mem_tracker_limiter.h +++ b/be/src/runtime/memory/mem_tracker_limiter.h @@ -165,7 +165,7 @@ class MemTrackerLimiter final : public MemTracker { TUniqueId querytid; parse_id(queryid, &querytid); return querytid; - }; + } static std::string process_mem_log_str() { return fmt::format( diff --git a/be/src/runtime/query_statistics.h b/be/src/runtime/query_statistics.h index 4990d29032b8e8..c1b2e4f0286157 100644 --- a/be/src/runtime/query_statistics.h +++ b/be/src/runtime/query_statistics.h @@ -29,7 +29,7 @@ class QueryStatisticsRecvr; class NodeStatistics { public: - NodeStatistics() : peak_memory_bytes(0) {}; + NodeStatistics() : peak_memory_bytes(0) {} void add_peak_memory(int64_t peak_memory) { this->peak_memory_bytes += peak_memory; } diff --git a/be/src/runtime/result_writer.h b/be/src/runtime/result_writer.h index 6b639acad82ba8..1d0bfde5895c59 100644 --- a/be/src/runtime/result_writer.h +++ b/be/src/runtime/result_writer.h @@ -33,9 +33,9 @@ class Block; // abstract class of the result writer class ResultWriter { public: - ResultWriter() {}; - ResultWriter(bool output_object_data) : _output_object_data(output_object_data) {}; - ~ResultWriter() {}; + ResultWriter() {} + ResultWriter(bool output_object_data) : _output_object_data(output_object_data) {} + ~ResultWriter() {} virtual Status init(RuntimeState* state) = 0; @@ -53,7 +53,7 @@ class ResultWriter { virtual void set_header_info(const std::string& header_type, const std::string& header) { _header_type = header_type; _header = header; - }; + } protected: int64_t _written_rows = 0; // number of rows written diff --git a/be/src/runtime/runtime_predicate.h b/be/src/runtime/runtime_predicate.h index 62ab5bcf4823f0..8e82217d704d5d 100644 --- a/be/src/runtime/runtime_predicate.h +++ b/be/src/runtime/runtime_predicate.h @@ -49,7 +49,7 @@ class RuntimePredicate { bool inited() { std::unique_lock wlock(_rwlock); return _inited; - }; + } void set_tablet_schema(TabletSchemaSPtr tablet_schema) { std::unique_lock wlock(_rwlock); diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h index 35ace169de7622..7a555e0336aba2 100644 --- a/be/src/runtime/runtime_state.h +++ b/be/src/runtime/runtime_state.h @@ -115,7 +115,7 @@ class RuntimeState { Status query_status() { std::lock_guard l(_process_status_lock); return _process_status; - }; + } // Appends error to the _error_log if there is space bool log_error(const std::string& error); diff --git a/be/src/util/arrow/block_convertor.cpp b/be/src/util/arrow/block_convertor.cpp index 1bc15364635caa..273fd4a676e8a7 100644 --- a/be/src/util/arrow/block_convertor.cpp +++ b/be/src/util/arrow/block_convertor.cpp @@ -69,12 +69,12 @@ class FromBlockConverter : public arrow::TypeVisitor { #define PRIMITIVE_VISIT(TYPE) \ arrow::Status Visit(const arrow::TYPE& type) override { return _visit(type); } - PRIMITIVE_VISIT(Int8Type); - PRIMITIVE_VISIT(Int16Type); - PRIMITIVE_VISIT(Int32Type); - PRIMITIVE_VISIT(Int64Type); - PRIMITIVE_VISIT(FloatType); - PRIMITIVE_VISIT(DoubleType); + PRIMITIVE_VISIT(Int8Type) + PRIMITIVE_VISIT(Int16Type) + PRIMITIVE_VISIT(Int32Type) + PRIMITIVE_VISIT(Int64Type) + PRIMITIVE_VISIT(FloatType) + PRIMITIVE_VISIT(DoubleType) #undef PRIMITIVE_VISIT diff --git a/be/src/util/hash_util.hpp b/be/src/util/hash_util.hpp index b563a902ce9fbc..27e884e942222b 100644 --- a/be/src/util/hash_util.hpp +++ b/be/src/util/hash_util.hpp @@ -274,7 +274,7 @@ class HashUtil { case 1: h ^= (uint64_t)data[0]; h *= m; - }; + } h ^= h >> r; h *= m; diff --git a/be/src/util/path_trie.hpp b/be/src/util/path_trie.hpp index 824260098347d0..c593b796ec6de8 100644 --- a/be/src/util/path_trie.hpp +++ b/be/src/util/path_trie.hpp @@ -28,7 +28,7 @@ namespace doris { template class PathTrie { public: - PathTrie() : _root("/", "*"), _root_value(nullptr), _separator('/') {}; + PathTrie() : _root("/", "*"), _root_value(nullptr), _separator('/') {} ~PathTrie() { if (_root_value != nullptr) { diff --git a/be/src/util/progress_updater.cpp b/be/src/util/progress_updater.cpp index f309d6971c95e3..c3f367032468bf 100644 --- a/be/src/util/progress_updater.cpp +++ b/be/src/util/progress_updater.cpp @@ -50,7 +50,7 @@ void ProgressUpdater::update(int64_t delta) { if (num_complete >= _total) { // Always print the final 100% complete - VLOG_DEBUG << _label << " 100\% Complete (" << num_complete << " out of " << _total << ")"; + VLOG_DEBUG << _label << " 100%% Complete (" << num_complete << " out of " << _total << ")"; return; } @@ -60,7 +60,7 @@ void ProgressUpdater::update(int64_t delta) { if (new_percentage - old_percentage > _update_period) { // Only update shared variable if this guy was the latest. __sync_val_compare_and_swap(&_last_output_percentage, old_percentage, new_percentage); - VLOG_DEBUG << _label << ": " << new_percentage << "\% Complete (" << num_complete + VLOG_DEBUG << _label << ": " << new_percentage << "%% Complete (" << num_complete << " out of " << _total << ")"; } } diff --git a/be/src/vec/aggregate_functions/aggregate_function.h b/be/src/vec/aggregate_functions/aggregate_function.h index 6309b0c994c0f1..43a726ec0e9f3f 100644 --- a/be/src/vec/aggregate_functions/aggregate_function.h +++ b/be/src/vec/aggregate_functions/aggregate_function.h @@ -430,9 +430,9 @@ class AggregateFunctionGuard { : _function(function), _data(std::make_unique(function->size_of_data())) { _function->create(_data.get()); - }; + } ~AggregateFunctionGuard() { _function->destroy(_data.get()); } - AggregateDataPtr data() { return _data.get(); }; + AggregateDataPtr data() { return _data.get(); } private: const IAggregateFunction* _function; diff --git a/be/src/vec/aggregate_functions/aggregate_function_sort.h b/be/src/vec/aggregate_functions/aggregate_function_sort.h index 1f19996f047cf9..d51ae9106ff6a8 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_sort.h +++ b/be/src/vec/aggregate_functions/aggregate_function_sort.h @@ -34,7 +34,7 @@ struct AggregateFunctionSortData { Block block; // The construct only support the template compiler, useless - AggregateFunctionSortData() {}; + AggregateFunctionSortData() : sort_desc() {}; AggregateFunctionSortData(SortDescription sort_desc, const Block& block) : sort_desc(std::move(sort_desc)), block(block.clone_empty()) {} diff --git a/be/src/vec/columns/column.h b/be/src/vec/columns/column.h index 6bd5ac7855f10c..6452c8f3ffdd87 100644 --- a/be/src/vec/columns/column.h +++ b/be/src/vec/columns/column.h @@ -349,7 +349,7 @@ class IColumn : public COW { virtual void update_hashes_with_value(std::vector& hashes, const uint8_t* __restrict null_data = nullptr) const { LOG(FATAL) << "update_hashes_with_value siphash not supported"; - }; + } /// Update state of hash function with value of n elements to avoid the virtual function call /// null_data to mark whether need to do hash compute, null_data == nullptr @@ -358,7 +358,7 @@ class IColumn : public COW { virtual void update_hashes_with_value(uint64_t* __restrict hashes, const uint8_t* __restrict null_data = nullptr) const { LOG(FATAL) << "update_hashes_with_value xxhash not supported"; - }; + } /// Update state of crc32 hash function with value of n elements to avoid the virtual function call /// null_data to mark whether need to do hash compute, null_data == nullptr @@ -366,7 +366,7 @@ class IColumn : public COW { virtual void update_crcs_with_value(std::vector& hash, PrimitiveType type, const uint8_t* __restrict null_data = nullptr) const { LOG(FATAL) << "update_crcs_with_value not supported"; - }; + } /** Removes elements that don't match the filter. * Is used in WHERE and HAVING operations. @@ -388,7 +388,7 @@ class IColumn : public COW { virtual Status filter_by_selector(const uint16_t* sel, size_t sel_size, IColumn* col_ptr) { LOG(FATAL) << "column not support filter_by_selector"; __builtin_unreachable(); - }; + } /// Permutes elements using specified permutation. Is used in sortings. /// limit - if it isn't 0, puts only first limit elements in the result. @@ -446,7 +446,7 @@ class IColumn : public COW { virtual void replicate(const uint32_t* counts, size_t target_size, IColumn& column, size_t begin = 0, int count_sz = -1) const { LOG(FATAL) << "not support"; - }; + } /** Split column to smaller columns. Each value goes to column index, selected by corresponding element of 'selector'. * Selector must contain values from 0 to num_columns - 1. @@ -539,7 +539,7 @@ class IColumn : public COW { virtual bool is_dummy() const { return false; } /// Clear data of column, just like vector clear - virtual void clear() {}; + virtual void clear() {} /** Memory layout properties. * @@ -704,6 +704,6 @@ namespace doris { struct ColumnPtrWrapper { vectorized::ColumnPtr column_ptr; - ColumnPtrWrapper(vectorized::ColumnPtr col) : column_ptr(col) {}; + ColumnPtrWrapper(vectorized::ColumnPtr col) : column_ptr(col) {} }; } // namespace doris diff --git a/be/src/vec/columns/column_complex.h b/be/src/vec/columns/column_complex.h index 4b6562d5349ba0..be52a156c3c719 100644 --- a/be/src/vec/columns/column_complex.h +++ b/be/src/vec/columns/column_complex.h @@ -203,8 +203,8 @@ class ColumnComplexType final : public COWHelper> virtual void update_hashes_with_value( std::vector& hashes, const uint8_t* __restrict null_data = nullptr) const override { - // TODO add hash function - }; + // TODO add hash function + } virtual void update_hashes_with_value( uint64_t* __restrict hashes, diff --git a/be/src/vec/columns/column_dictionary.h b/be/src/vec/columns/column_dictionary.h index 122f15d9f019a3..eada23d57162fb 100644 --- a/be/src/vec/columns/column_dictionary.h +++ b/be/src/vec/columns/column_dictionary.h @@ -167,15 +167,15 @@ class ColumnDictionary final : public COWHelper> { [[noreturn]] ColumnPtr filter(const IColumn::Filter& filt, ssize_t result_size_hint) const override { LOG(FATAL) << "filter not supported in ColumnDictionary"; - }; + } [[noreturn]] ColumnPtr permute(const IColumn::Permutation& perm, size_t limit) const override { LOG(FATAL) << "permute not supported in ColumnDictionary"; - }; + } [[noreturn]] ColumnPtr replicate(const IColumn::Offsets& replicate_offsets) const override { LOG(FATAL) << "replicate not supported in ColumnDictionary"; - }; + } [[noreturn]] MutableColumns scatter(IColumn::ColumnIndex num_columns, const IColumn::Selector& selector) const override { @@ -320,7 +320,7 @@ class ColumnDictionary final : public COWHelper> { class Dictionary { public: - Dictionary() : _dict_data(new DictContainer()), _total_str_len(0) {}; + Dictionary() : _dict_data(new DictContainer()), _total_str_len(0) {} void reserve(size_t n) { _dict_data->reserve(n); } diff --git a/be/src/vec/columns/column_string.h b/be/src/vec/columns/column_string.h index 0fa80190d86840..829a40a2cc9e7c 100644 --- a/be/src/vec/columns/column_string.h +++ b/be/src/vec/columns/column_string.h @@ -255,7 +255,7 @@ class ColumnString final : public COWHelper { offset += len; offsets.push_back(offset); } - }; + } void insert_many_strings(const StringRef* strings, size_t num) override { size_t new_size = 0; diff --git a/be/src/vec/columns/predicate_column.h b/be/src/vec/columns/predicate_column.h index e2a464b5eaefa7..5a276233da5bef 100644 --- a/be/src/vec/columns/predicate_column.h +++ b/be/src/vec/columns/predicate_column.h @@ -422,11 +422,11 @@ class PredicateColumnType final : public COWHelper #include #include #include @@ -242,8 +243,9 @@ struct StringRef { StringRef trim() const; // support for type_limit - static constexpr char MIN_CHAR = 0x00; - static constexpr char MAX_CHAR = 0xFF; + static constexpr char MIN_CHAR = 0; + static constexpr char MAX_CHAR = char( + UCHAR_MAX); // We will convert char to uchar and compare, so we define max_char to unsigned char max. static StringRef min_string_val(); static StringRef max_string_val(); diff --git a/be/src/vec/core/sort_cursor.h b/be/src/vec/core/sort_cursor.h index 8990ce0d074481..74a9762673c297 100644 --- a/be/src/vec/core/sort_cursor.h +++ b/be/src/vec/core/sort_cursor.h @@ -112,7 +112,7 @@ struct HeapSortCursorImpl { if (_block_view) { _block_view->unref(); } - }; + } size_t row_id() const { return _row_id; } diff --git a/be/src/vec/data_types/data_type.h b/be/src/vec/data_types/data_type.h index e5f0e6aa4cd639..900d7b7ac12cba 100644 --- a/be/src/vec/data_types/data_type.h +++ b/be/src/vec/data_types/data_type.h @@ -32,7 +32,6 @@ namespace doris { class PBlock; class PColumn; -enum FieldType; namespace vectorized { diff --git a/be/src/vec/exec/format/orc/vorc_reader.h b/be/src/vec/exec/format/orc/vorc_reader.h index daf2e8cd6831bc..36e66b4295098f 100644 --- a/be/src/vec/exec/format/orc/vorc_reader.h +++ b/be/src/vec/exec/format/orc/vorc_reader.h @@ -38,7 +38,7 @@ class ORCFileInputStream : public orc::InputStream { }; ORCFileInputStream(const std::string& file_name, io::FileReaderSPtr file_reader) - : _file_name(file_name), _file_reader(file_reader) {}; + : _file_name(file_name), _file_reader(file_reader) {} ~ORCFileInputStream() override = default; diff --git a/be/src/vec/exec/format/parquet/parquet_common.h b/be/src/vec/exec/format/parquet/parquet_common.h index a3d3e0d8a45790..c06d8690ac5952 100644 --- a/be/src/vec/exec/format/parquet/parquet_common.h +++ b/be/src/vec/exec/format/parquet/parquet_common.h @@ -58,7 +58,7 @@ struct RowRange { struct ParquetReadColumn { ParquetReadColumn(int parquet_col_id, const std::string& file_slot_name) - : _parquet_col_id(parquet_col_id), _file_slot_name(file_slot_name) {}; + : _parquet_col_id(parquet_col_id), _file_slot_name(file_slot_name) {} int _parquet_col_id; const std::string& _file_slot_name; @@ -223,7 +223,7 @@ void Decoder::init_decimal_converter(DataTypePtr& data_type) { class FixLengthDecoder final : public Decoder { public: - FixLengthDecoder(tparquet::Type::type physical_type) : _physical_type(physical_type) {}; + FixLengthDecoder(tparquet::Type::type physical_type) : _physical_type(physical_type) {} ~FixLengthDecoder() override = default; Status decode_values(MutableColumnPtr& doris_column, DataTypePtr& data_type, diff --git a/be/src/vec/exec/format/parquet/schema_desc.h b/be/src/vec/exec/format/parquet/schema_desc.h index c45e96f236bd98..cb74b48b569e7b 100644 --- a/be/src/vec/exec/format/parquet/schema_desc.h +++ b/be/src/vec/exec/format/parquet/schema_desc.h @@ -114,7 +114,7 @@ class FieldDescriptor { std::string debug_string() const; - int32_t size() const { return _fields.size(); }; + int32_t size() const { return _fields.size(); } }; } // namespace doris::vectorized diff --git a/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.h b/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.h index 1bb1d017ceb91e..b73513751c5628 100644 --- a/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.h +++ b/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.h @@ -110,7 +110,7 @@ class ColumnChunkReader { return load_page_data(); } // The remaining number of values in current page(including null values). Decreased when reading or skipping. - uint32_t remaining_num_values() const { return _remaining_num_values; }; + uint32_t remaining_num_values() const { return _remaining_num_values; } // null values are generated from definition levels // the caller should maintain the consistency after analyzing null values from definition levels. void insert_null_values(MutableColumnPtr& doris_column, size_t num_values); diff --git a/be/src/vec/exec/format/parquet/vparquet_column_reader.h b/be/src/vec/exec/format/parquet/vparquet_column_reader.h index 8dff684730843c..0d54e427242a30 100644 --- a/be/src/vec/exec/format/parquet/vparquet_column_reader.h +++ b/be/src/vec/exec/format/parquet/vparquet_column_reader.h @@ -30,12 +30,12 @@ class ParquetColumnMetadata { tparquet::ColumnMetaData metadata) : _chunk_start_offset(chunk_start_offset), _chunk_length(chunk_length), - _metadata(metadata) {}; + _metadata(metadata) {} ~ParquetColumnMetadata() = default; - int64_t start_offset() const { return _chunk_start_offset; }; - int64_t size() const { return _chunk_length; }; - tparquet::ColumnMetaData t_metadata() { return _metadata; }; + int64_t start_offset() const { return _chunk_start_offset; } + int64_t size() const { return _chunk_length; } + tparquet::ColumnMetaData t_metadata() { return _metadata; } private: int64_t _chunk_start_offset; @@ -97,13 +97,13 @@ class ParquetColumnReader { }; ParquetColumnReader(const std::vector& row_ranges, cctz::time_zone* ctz) - : _row_ranges(row_ranges), _ctz(ctz) {}; + : _row_ranges(row_ranges), _ctz(ctz) {} virtual ~ParquetColumnReader() { if (_stream_reader != nullptr) { delete _stream_reader; _stream_reader = nullptr; } - }; + } virtual Status read_column_data(ColumnPtr& doris_column, DataTypePtr& type, ColumnSelectVector& select_vector, size_t batch_size, size_t* read_rows, bool* eof) = 0; @@ -137,8 +137,8 @@ class ParquetColumnReader { class ScalarColumnReader : public ParquetColumnReader { public: ScalarColumnReader(const std::vector& row_ranges, cctz::time_zone* ctz) - : ParquetColumnReader(row_ranges, ctz) {}; - ~ScalarColumnReader() override { close(); }; + : ParquetColumnReader(row_ranges, ctz) {} + ~ScalarColumnReader() override { close(); } Status init(io::FileReaderSPtr file, FieldSchema* field, tparquet::ColumnChunk* chunk, size_t max_buf_size); Status read_column_data(ColumnPtr& doris_column, DataTypePtr& type, @@ -153,8 +153,8 @@ class ScalarColumnReader : public ParquetColumnReader { class ArrayColumnReader : public ParquetColumnReader { public: ArrayColumnReader(const std::vector& row_ranges, cctz::time_zone* ctz) - : ParquetColumnReader(row_ranges, ctz) {}; - ~ArrayColumnReader() override { close(); }; + : ParquetColumnReader(row_ranges, ctz) {} + ~ArrayColumnReader() override { close(); } Status init(io::FileReaderSPtr file, FieldSchema* field, tparquet::ColumnChunk* chunk, size_t max_buf_size); Status read_column_data(ColumnPtr& doris_column, DataTypePtr& type, diff --git a/be/src/vec/exec/format/parquet/vparquet_file_metadata.h b/be/src/vec/exec/format/parquet/vparquet_file_metadata.h index ce2cde51461dcc..19c6ce98f98ad1 100644 --- a/be/src/vec/exec/format/parquet/vparquet_file_metadata.h +++ b/be/src/vec/exec/format/parquet/vparquet_file_metadata.h @@ -27,7 +27,7 @@ class FileMetaData { FileMetaData(tparquet::FileMetaData& metadata); ~FileMetaData() = default; Status init_schema(); - const FieldDescriptor& schema() const { return _schema; }; + const FieldDescriptor& schema() const { return _schema; } const tparquet::FileMetaData& to_thrift(); std::string debug_string() const; diff --git a/be/src/vec/exec/scan/new_olap_scan_node.cpp b/be/src/vec/exec/scan/new_olap_scan_node.cpp index 3ff4d8943b8a84..d50226b47b809a 100644 --- a/be/src/vec/exec/scan/new_olap_scan_node.cpp +++ b/be/src/vec/exec/scan/new_olap_scan_node.cpp @@ -338,8 +338,6 @@ void NewOlapScanNode::set_scan_ranges(const std::vector& scan_ COUNTER_UPDATE(_tablet_counter, 1); } // telemetry::set_current_span_attribute(_tablet_counter); - - return; } std::string NewOlapScanNode::get_name() { diff --git a/be/src/vec/exec/scan/new_olap_scanner.cpp b/be/src/vec/exec/scan/new_olap_scanner.cpp index a36afecf689d8a..0af436af006f65 100644 --- a/be/src/vec/exec/scan/new_olap_scanner.cpp +++ b/be/src/vec/exec/scan/new_olap_scanner.cpp @@ -479,11 +479,6 @@ void NewOlapScanner::_update_counters_before_close() { COUNTER_UPDATE(olap_parent->_conditions_filtered_counter, stats.rows_conditions_filtered); COUNTER_UPDATE(olap_parent->_key_range_filtered_counter, stats.rows_key_range_filtered); - size_t timer_count = sizeof(stats.general_debug_ns) / sizeof(*stats.general_debug_ns); - for (size_t i = 0; i < timer_count; ++i) { - COUNTER_UPDATE(olap_parent->_general_debug_timer[i], stats.general_debug_ns[i]); - } - COUNTER_UPDATE(olap_parent->_total_pages_num_counter, stats.total_pages_num); COUNTER_UPDATE(olap_parent->_cached_pages_num_counter, stats.cached_pages_num); diff --git a/be/src/vec/exec/scan/vfile_scanner.h b/be/src/vec/exec/scan/vfile_scanner.h index fb6c78b5d035bb..9a00e10dab4780 100644 --- a/be/src/vec/exec/scan/vfile_scanner.h +++ b/be/src/vec/exec/scan/vfile_scanner.h @@ -53,7 +53,7 @@ class VFileScanner : public VScanner { Status _get_next_reader(); // TODO: cast input block columns type to string. - Status _cast_src_block(Block* block) { return Status::OK(); }; + Status _cast_src_block(Block* block) { return Status::OK(); } protected: std::unique_ptr _text_converter; diff --git a/be/src/vec/exec/scan/vmeta_scan_node.h b/be/src/vec/exec/scan/vmeta_scan_node.h index 93774f89d15e7c..745882a2d34450 100644 --- a/be/src/vec/exec/scan/vmeta_scan_node.h +++ b/be/src/vec/exec/scan/vmeta_scan_node.h @@ -30,7 +30,7 @@ class VMetaScanNode : public VScanNode { Status init(const TPlanNode& tnode, RuntimeState* state = nullptr) override; Status prepare(RuntimeState* state) override; void set_scan_ranges(const std::vector& scan_ranges) override; - const TMetaScanNode& scan_params() { return _scan_params; }; + const TMetaScanNode& scan_params() { return _scan_params; } private: Status _init_profile() override; diff --git a/be/src/vec/exprs/vbitmap_predicate.h b/be/src/vec/exprs/vbitmap_predicate.h index f83ed7a5cf7613..629a240218366c 100644 --- a/be/src/vec/exprs/vbitmap_predicate.h +++ b/be/src/vec/exprs/vbitmap_predicate.h @@ -54,7 +54,7 @@ class VBitmapPredicate final : public VExpr { std::string debug_string() const override { return fmt::format(" VBitmapPredicate:{}", VExpr::debug_string()); - }; + } private: std::shared_ptr _filter; diff --git a/be/src/vec/exprs/vexpr.h b/be/src/vec/exprs/vexpr.h index 54577a67dd3288..d20c2e59bab0fe 100644 --- a/be/src/vec/exprs/vexpr.h +++ b/be/src/vec/exprs/vexpr.h @@ -151,7 +151,7 @@ class VExpr { /// expr. Status get_const_col(VExprContext* context, ColumnPtrWrapper** output); - int fn_context_index() const { return _fn_context_index; }; + int fn_context_index() const { return _fn_context_index; } static const VExpr* expr_without_cast(const VExpr* expr) { if (expr->node_type() == doris::TExprNodeType::CAST_EXPR) { diff --git a/be/src/vec/exprs/vin_predicate.h b/be/src/vec/exprs/vin_predicate.h index 75048d46729a0b..d8853ab488e559 100644 --- a/be/src/vec/exprs/vin_predicate.h +++ b/be/src/vec/exprs/vin_predicate.h @@ -40,7 +40,7 @@ class VInPredicate final : public VExpr { std::string debug_string() const override; - const FunctionBasePtr function() { return _function; }; + const FunctionBasePtr function() { return _function; } bool is_not_in() const { return _is_not_in; }; diff --git a/be/src/vec/exprs/vliteral.h b/be/src/vec/exprs/vliteral.h index 90f40be81c36ab..fcea4d9ffd696d 100644 --- a/be/src/vec/exprs/vliteral.h +++ b/be/src/vec/exprs/vliteral.h @@ -31,7 +31,7 @@ class VLiteral : public VExpr { if (should_init) { init(node); } - }; + } Status execute(VExprContext* context, vectorized::Block* block, int* result_column_id) override; const std::string& expr_name() const override { return _expr_name; } VExpr* clone(doris::ObjectPool* pool) const override { return pool->add(new VLiteral(*this)); } diff --git a/be/src/vec/exprs/vruntimefilter_wrapper.h b/be/src/vec/exprs/vruntimefilter_wrapper.h index b98e7b97189d7b..e63d09691aa570 100644 --- a/be/src/vec/exprs/vruntimefilter_wrapper.h +++ b/be/src/vec/exprs/vruntimefilter_wrapper.h @@ -31,7 +31,7 @@ class VRuntimeFilterWrapper final : public VExpr { VExprContext* context) override; doris::Status open(doris::RuntimeState* state, VExprContext* context, FunctionContext::FunctionStateScope scope) override; - std::string debug_string() const override { return _impl->debug_string(); }; + std::string debug_string() const override { return _impl->debug_string(); } bool is_constant() const override; void close(doris::RuntimeState* state, VExprContext* context, FunctionContext::FunctionStateScope scope) override; diff --git a/be/src/vec/functions/function_java_udf.h b/be/src/vec/functions/function_java_udf.h index 3f88b4226eb052..9d9a4f8062e980 100644 --- a/be/src/vec/functions/function_java_udf.h +++ b/be/src/vec/functions/function_java_udf.h @@ -41,10 +41,10 @@ class JavaFunctionCall : public IFunctionBase { } /// Get the main function name. - String get_name() const override { return fn_.name.function_name; }; + String get_name() const override { return fn_.name.function_name; } - const DataTypes& get_argument_types() const override { return _argument_types; }; - const DataTypePtr& get_return_type() const override { return _return_type; }; + const DataTypes& get_argument_types() const override { return _argument_types; } + const DataTypePtr& get_return_type() const override { return _return_type; } PreparedFunctionPtr prepare(FunctionContext* context, const Block& sample_block, const ColumnNumbers& arguments, size_t result) const override { diff --git a/be/src/vec/functions/function_rpc.h b/be/src/vec/functions/function_rpc.h index 56d953744f3bb5..583b37deae0293 100644 --- a/be/src/vec/functions/function_rpc.h +++ b/be/src/vec/functions/function_rpc.h @@ -72,10 +72,10 @@ class FunctionRPC : public IFunctionBase { String get_name() const override { return fmt::format("{}: [{}/{}]", _tfn.name.function_name, _tfn.hdfs_location, _tfn.scalar_fn.symbol); - }; + } - const DataTypes& get_argument_types() const override { return _argument_types; }; - const DataTypePtr& get_return_type() const override { return _return_type; }; + const DataTypes& get_argument_types() const override { return _argument_types; } + const DataTypePtr& get_return_type() const override { return _return_type; } PreparedFunctionPtr prepare(FunctionContext* context, const Block& sample_block, const ColumnNumbers& arguments, size_t result) const override { diff --git a/be/src/vec/functions/regexps.h b/be/src/vec/functions/regexps.h index b21ae52860843d..ffa9d881738859 100644 --- a/be/src/vec/functions/regexps.h +++ b/be/src/vec/functions/regexps.h @@ -32,8 +32,6 @@ #include #include "vec/common/string_ref.h" -#include "vec/data_types/data_type_number.h" -#include "vec/data_types/data_type_string.h" namespace doris::vectorized { @@ -230,7 +228,7 @@ inline DeferredConstructedRegexpsPtr getOrSet(const std::vector& patt /// option to reference the corresponding string patterns / edit distance key in the cache table bucket because the cache entry may /// already be evicted at the time the compilation starts. - if (bucket.regexps == nullptr) [[unlikely]] { + if (bucket.regexps == nullptr) { /// insert new entry auto deferred_constructed_regexps = std::make_shared([str_patterns, edit_distance]() { diff --git a/be/src/vec/olap/vcollect_iterator.h b/be/src/vec/olap/vcollect_iterator.h index 7ac29858cdbf30..cf600e53ef436d 100644 --- a/be/src/vec/olap/vcollect_iterator.h +++ b/be/src/vec/olap/vcollect_iterator.h @@ -82,12 +82,12 @@ class VCollectIterator { public: LevelIterator(TabletReader* reader) : _schema(reader->tablet_schema()), - _compare_columns(reader->_reader_context.read_orderby_key_columns) {}; + _compare_columns(reader->_reader_context.read_orderby_key_columns) {} virtual Status init(bool get_data_by_ref = false) = 0; virtual Status init_for_union(bool is_first_child, bool get_data_by_ref = false) { return Status::OK(); - }; + } virtual int64_t version() const = 0; @@ -103,9 +103,9 @@ class VCollectIterator { virtual ~LevelIterator() = default; - const TabletSchema& tablet_schema() const { return _schema; }; + const TabletSchema& tablet_schema() const { return _schema; } - const inline std::vector* compare_columns() const { return _compare_columns; }; + const inline std::vector* compare_columns() const { return _compare_columns; } virtual RowLocation current_row_location() = 0; diff --git a/be/src/vec/runtime/vdatetime_value.h b/be/src/vec/runtime/vdatetime_value.h index a49209492a04f0..426eaa3ff260d8 100644 --- a/be/src/vec/runtime/vdatetime_value.h +++ b/be/src/vec/runtime/vdatetime_value.h @@ -340,7 +340,7 @@ class VecDateTimeValue { // Now this type is a temp solution with little changes // Return true if convert success. Otherwise return false. bool from_date_int64(int64_t value); - bool from_date(int64_t value) { return from_date_int64(value); }; + bool from_date(int64_t value) { return from_date_int64(value); } // Construct time type value from int64_t value. // Return true if convert success. Otherwise return false. @@ -378,7 +378,7 @@ class VecDateTimeValue { // Now this type is a temp solution with little changes } set_time(year, month, day, hour, minute, second); return true; - }; + } uint64_t daynr() const { return calc_daynr(_year, _month, _day); } @@ -505,7 +505,7 @@ class VecDateTimeValue { // Now this type is a temp solution with little changes template bool operator!=(const DateV2Value& other) const { return !(*this == other); - }; + } template bool operator<=(const DateV2Value& other) const; @@ -563,14 +563,14 @@ class VecDateTimeValue { // Now this type is a temp solution with little changes uint32_t to_date_v2() const { CHECK(_type == TIME_DATE); return (year() << 9 | month() << 5 | day()); - }; + } uint64_t to_datetime_v2() const { CHECK(_type == TIME_DATETIME); return (uint64_t)(((uint64_t)year() << 46) | ((uint64_t)month() << 42) | ((uint64_t)day() << 37) | ((uint64_t)hour() << 32) | ((uint64_t)minute() << 26) | ((uint64_t)second() << 20)); - }; + } static VecDateTimeValue from_datetime_val(const doris_udf::DateTimeVal& tv) { VecDateTimeValue value; @@ -832,7 +832,7 @@ class DateV2Value { set_time(year, month, day, hour, minute, second, microsecond); } return true; - }; + } uint32_t daynr() const { return calc_daynr(date_v2_value_.year_, date_v2_value_.month_, date_v2_value_.day_); @@ -1070,7 +1070,7 @@ class DateV2Value { int day_diff = daynr() - rhs.daynr(); return day_diff * 3600 * 24 + (hour() * 3600 + minute() * 60 + second()) - (rhs.hour() * 3600 + rhs.minute() * 60 + rhs.second()); - }; + } int64_t time_part_diff(const VecDateTimeValue& rhs) const { int time_diff = (hour() * 3600 + minute() * 60 + second()) - @@ -1140,7 +1140,7 @@ class DateV2Value { } else { return date_v2_value_.year_ * 10000 + date_v2_value_.month_ * 100 + date_v2_value_.day_; } - }; + } bool from_date_format_str(const char* format, int format_len, const char* value, int value_len, const char** sub_val_end); diff --git a/be/src/vec/sink/vmysql_result_writer.h b/be/src/vec/sink/vmysql_result_writer.h index 58282d413ca925..0e6a77f00d9dcf 100644 --- a/be/src/vec/sink/vmysql_result_writer.h +++ b/be/src/vec/sink/vmysql_result_writer.h @@ -46,7 +46,7 @@ class VMysqlResultWriter final : public VResultWriter { virtual Status close() override; - const ResultList& results() { return _results; }; + const ResultList& results() { return _results; } private: void _init_profile(); diff --git a/be/test/agent/cgroups_mgr_test.cpp b/be/test/agent/cgroups_mgr_test.cpp index 5e5ed629065b19..d342efa2a92cbe 100644 --- a/be/test/agent/cgroups_mgr_test.cpp +++ b/be/test/agent/cgroups_mgr_test.cpp @@ -21,13 +21,8 @@ #include #include -#include "gmock/gmock.h" #include "gtest/gtest.h" -#ifndef BE_TEST -#define BE_TEST -#endif - using ::testing::_; using ::testing::Return; using ::testing::SetArgPointee; diff --git a/be/test/olap/file_helper_test.cpp b/be/test/olap/file_helper_test.cpp index 7a7a2388174ba2..fe8ab229807057 100644 --- a/be/test/olap/file_helper_test.cpp +++ b/be/test/olap/file_helper_test.cpp @@ -21,17 +21,11 @@ #include #include -#include "common/configbase.h" #include "common/status.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "olap/olap_define.h" #include "testutil/test_util.h" -#ifndef BE_TEST -#define BE_TEST -#endif - using ::testing::_; using ::testing::Return; using ::testing::SetArgPointee; diff --git a/be/test/olap/file_utils_test.cpp b/be/test/olap/file_utils_test.cpp index 51dcd489c466e8..8417b9b4096c3a 100644 --- a/be/test/olap/file_utils_test.cpp +++ b/be/test/olap/file_utils_test.cpp @@ -23,17 +23,11 @@ #include #include -#include "common/configbase.h" #include "common/status.h" #include "env/env.h" #include "gmock/gmock.h" #include "gtest/gtest.h" #include "olap/file_helper.h" -#include "olap/olap_define.h" - -#ifndef BE_TEST -#define BE_TEST -#endif using ::testing::_; using ::testing::Return; diff --git a/be/test/olap/olap_meta_test.cpp b/be/test/olap/olap_meta_test.cpp index 43de818fec5c64..5d5339c0dff9c8 100644 --- a/be/test/olap/olap_meta_test.cpp +++ b/be/test/olap/olap_meta_test.cpp @@ -26,10 +26,6 @@ #include "olap/olap_define.h" #include "util/file_utils.h" -#ifndef BE_TEST -#define BE_TEST -#endif - using std::string; namespace doris { diff --git a/be/test/olap/rowset/rowset_meta_manager_test.cpp b/be/test/olap/rowset/rowset_meta_manager_test.cpp index 1927d6adbdbbaf..11ef3acf8a6b66 100644 --- a/be/test/olap/rowset/rowset_meta_manager_test.cpp +++ b/be/test/olap/rowset/rowset_meta_manager_test.cpp @@ -25,14 +25,9 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "json2pb/json_to_pb.h" #include "olap/olap_meta.h" #include "olap/storage_engine.h" -#ifndef BE_TEST -#define BE_TEST -#endif - using ::testing::_; using ::testing::Return; using ::testing::SetArgPointee; diff --git a/be/test/olap/rowset/rowset_meta_test.cpp b/be/test/olap/rowset/rowset_meta_test.cpp index 6a998fc8779535..dada473a60de2c 100644 --- a/be/test/olap/rowset/rowset_meta_test.cpp +++ b/be/test/olap/rowset/rowset_meta_test.cpp @@ -24,13 +24,8 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "json2pb/json_to_pb.h" #include "olap/olap_meta.h" -#ifndef BE_TEST -#define BE_TEST -#endif - using ::testing::_; using ::testing::Return; using ::testing::SetArgPointee; diff --git a/be/test/olap/rowset/segment_v2/inverted_index_searcher_cache_test.cpp b/be/test/olap/rowset/segment_v2/inverted_index_searcher_cache_test.cpp index 71167b6a572835..b2ad7d58ab3bc6 100644 --- a/be/test/olap/rowset/segment_v2/inverted_index_searcher_cache_test.cpp +++ b/be/test/olap/rowset/segment_v2/inverted_index_searcher_cache_test.cpp @@ -17,19 +17,11 @@ #include -#include "common/logging.h" #include "io/fs/local_file_system.h" #include "olap/rowset/segment_v2/inverted_index_cache.h" #include "util/file_utils.h" #include "util/time.h" -#define protected public -#define private public - -#ifndef BE_TEST -#define BE_TEST -#endif - namespace doris { namespace segment_v2 { diff --git a/be/test/olap/tablet_meta_manager_test.cpp b/be/test/olap/tablet_meta_manager_test.cpp index e365ee48145fd7..da170b597217c5 100644 --- a/be/test/olap/tablet_meta_manager_test.cpp +++ b/be/test/olap/tablet_meta_manager_test.cpp @@ -25,13 +25,6 @@ #include #include -#include "olap/olap_define.h" -#include "util/file_utils.h" - -#ifndef BE_TEST -#define BE_TEST -#endif - using std::string; namespace doris { diff --git a/be/test/olap/tablet_mgr_test.cpp b/be/test/olap/tablet_mgr_test.cpp index 12838e9b229603..d7297fc3b8e7b6 100644 --- a/be/test/olap/tablet_mgr_test.cpp +++ b/be/test/olap/tablet_mgr_test.cpp @@ -22,18 +22,11 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "json2pb/json_to_pb.h" -#include "olap/olap_meta.h" -#include "olap/rowset/rowset_meta_manager.h" #include "olap/storage_engine.h" #include "olap/tablet_meta_manager.h" #include "olap/txn_manager.h" #include "util/file_utils.h" -#ifndef BE_TEST -#define BE_TEST -#endif - using ::testing::_; using ::testing::Return; using ::testing::SetArgPointee; diff --git a/be/test/olap/txn_manager_test.cpp b/be/test/olap/txn_manager_test.cpp index 88b33c2a514f91..55fc41cc1435a5 100644 --- a/be/test/olap/txn_manager_test.cpp +++ b/be/test/olap/txn_manager_test.cpp @@ -24,17 +24,12 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "json2pb/json_to_pb.h" #include "olap/olap_meta.h" #include "olap/rowset/rowset.h" #include "olap/rowset/rowset_factory.h" #include "olap/rowset/rowset_meta_manager.h" #include "olap/storage_engine.h" -#ifndef BE_TEST -#define BE_TEST -#endif - using ::testing::_; using ::testing::Return; using ::testing::SetArgPointee; diff --git a/be/test/runtime/snapshot_loader_test.cpp b/be/test/runtime/snapshot_loader_test.cpp index 5e0349efe6de70..74e93d072368be 100644 --- a/be/test/runtime/snapshot_loader_test.cpp +++ b/be/test/runtime/snapshot_loader_test.cpp @@ -15,17 +15,13 @@ // specific language governing permissions and limitations // under the License. +#include "runtime/snapshot_loader.h" + #include #include #include "runtime/exec_env.h" -#include "util/cpu_info.h" - -#define private public // hack compiler -#define protected public - -#include "runtime/snapshot_loader.h" namespace doris { diff --git a/be/test/testutil/mock_rowset.h b/be/test/testutil/mock_rowset.h index e17f7435d502d5..e13008536a4383 100644 --- a/be/test/testutil/mock_rowset.h +++ b/be/test/testutil/mock_rowset.h @@ -23,36 +23,34 @@ namespace doris { class MockRowset : public Rowset { - virtual Status create_reader(std::shared_ptr* result) override { + Status create_reader(std::shared_ptr* result) override { return Status::NotSupported("MockRowset not support this method."); } - virtual Status remove() override { - return Status::NotSupported("MockRowset not support this method."); - } + Status remove() override { return Status::NotSupported("MockRowset not support this method."); } - virtual Status link_files_to(const std::string& dir, RowsetId new_rowset_id, - size_t start_seg_id) override { + Status link_files_to(const std::string& dir, RowsetId new_rowset_id, + size_t start_seg_id) override { return Status::NotSupported("MockRowset not support this method."); } - virtual Status copy_files_to(const std::string& dir, const RowsetId& new_rowset_id) override { + Status copy_files_to(const std::string& dir, const RowsetId& new_rowset_id) override { return Status::NotSupported("MockRowset not support this method."); } - virtual Status remove_old_files(std::vector* files_to_remove) override { + Status remove_old_files(std::vector* files_to_remove) override { return Status::NotSupported("MockRowset not support this method."); } - virtual bool check_path(const std::string& path) override { + bool check_path(const std::string& path) override { return Status::NotSupported("MockRowset not support this method."); } - virtual bool check_file_exist() override { + bool check_file_exist() override { return Status::NotSupported("MockRowset not support this method."); } - virtual Status get_segments_key_bounds(std::vector* segments_key_bounds) override { + Status get_segments_key_bounds(std::vector* segments_key_bounds) override { // TODO(zhangchen): remove this after we implemented memrowset. if (is_mem_rowset_) { return Status::NotSupported("Memtable not support key bounds"); @@ -73,19 +71,17 @@ class MockRowset : public Rowset { RowsetMetaSharedPtr rowset_meta) : Rowset(schema, rowset_path, rowset_meta) {} - virtual Status init() override { - return Status::NotSupported("MockRowset not support this method."); - } + Status init() override { return Status::NotSupported("MockRowset not support this method."); } - virtual Status do_load(bool use_cache) override { + Status do_load(bool use_cache) override { return Status::NotSupported("MockRowset not support this method."); } - virtual void do_close() override { + void do_close() override { // Do nothing. } - virtual bool check_current_rowset_segment() override { return true; }; + bool check_current_rowset_segment() override { return true; } private: bool is_mem_rowset_; diff --git a/be/test/util/bitmap_value_test.cpp b/be/test/util/bitmap_value_test.cpp index ee950744dbc961..92d3ea04d73bda 100644 --- a/be/test/util/bitmap_value_test.cpp +++ b/be/test/util/bitmap_value_test.cpp @@ -15,14 +15,14 @@ // specific language governing permissions and limitations // under the License. +#include "util/bitmap_value.h" + #include #include #include #include "util/coding.h" -#define private public -#include "util/bitmap_value.h" namespace doris { using roaring::Roaring; diff --git a/be/test/vec/exec/vgeneric_iterators_test.cpp b/be/test/vec/exec/vgeneric_iterators_test.cpp index 598cde284b41a2..f51a85b25cea64 100644 --- a/be/test/vec/exec/vgeneric_iterators_test.cpp +++ b/be/test/vec/exec/vgeneric_iterators_test.cpp @@ -239,7 +239,7 @@ class SeqColumnUtIterator : public RowwiseIterator { ~SeqColumnUtIterator() override {} // NOTE: Currently, this function will ignore StorageReadOptions - Status init(const StorageReadOptions& opts) override { return Status::OK(); }; + Status init(const StorageReadOptions& opts) override { return Status::OK(); } Status next_batch(vectorized::Block* block) override { int row_idx = 0; diff --git a/be/test/vec/jsonb/serialize_test.cpp b/be/test/vec/jsonb/serialize_test.cpp index 625c206acf25c1..75faa5e916abc6 100644 --- a/be/test/vec/jsonb/serialize_test.cpp +++ b/be/test/vec/jsonb/serialize_test.cpp @@ -14,28 +14,26 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. +#include "vec/jsonb/serialize.h" + #include #include "gen_cpp/descriptors.pb.h" -#include "vec/core/block.h" -#include "vec/core/types.h" -#define private public #include "olap/tablet_schema.h" #include "vec/columns/column_array.h" #include "vec/columns/column_decimal.h" #include "vec/columns/column_nullable.h" #include "vec/columns/column_string.h" #include "vec/columns/column_vector.h" +#include "vec/core/block.h" +#include "vec/core/types.h" #include "vec/data_types/data_type.h" #include "vec/data_types/data_type_array.h" -#include "vec/data_types/data_type_bitmap.h" -#include "vec/data_types/data_type_date.h" #include "vec/data_types/data_type_date_time.h" #include "vec/data_types/data_type_decimal.h" #include "vec/data_types/data_type_nullable.h" #include "vec/data_types/data_type_number.h" #include "vec/data_types/data_type_string.h" -#include "vec/jsonb/serialize.h" #include "vec/runtime/vdatetime_value.h" namespace doris::vectorized { diff --git a/docs/en/community/developer-guide/cpp-diagnostic-code.md b/docs/en/community/developer-guide/cpp-diagnostic-code.md index b4fa4f042a45d4..ebfde51503c0ae 100644 --- a/docs/en/community/developer-guide/cpp-diagnostic-code.md +++ b/docs/en/community/developer-guide/cpp-diagnostic-code.md @@ -35,20 +35,20 @@ Clang-Tidy can do some diagnostic cofig, config file `.clang-tidy` is in Doris r ### Enable clangd on VSCODE First we should install clangd plugin, then edit `settings.json` or just change config on gui. +Before using, compile `be(RELEASE)` and `be-ut(ASAN)` once to generate the corresponding `compile_commands.json` file. ```json "clangd.path": "ldb_toolchain/bin/clangd", //clangd path "clangd.arguments": [ "--background-index", "--clang-tidy", //enable clang-tidy - "--compile-commands-dir=doris/be/build_RELEASE/", //clangd should read compile_commands.json create by cmake, so you should compile once + "--compile-commands-dir=doris/be/build_Release/", "--completion-style=detailed", "-j=5", //clangd diagnostic parallelism "--all-scopes-completion", "--pch-storage=memory", "--pretty", - "-log=verbose", "--query-driver=ldb_toolchain/bin/*" //path of compiler ], - "clangd.trace": "/home/disk2/pxl/dev/baidu/bdg/doris/core/output/clangd-server.log" //clangd log path + "clangd.trace": "output/clangd-server.log" ``` diff --git a/docs/zh-CN/community/developer-guide/cpp-diagnostic-code.md b/docs/zh-CN/community/developer-guide/cpp-diagnostic-code.md index 2b45a294496f9d..7279f246898f00 100644 --- a/docs/zh-CN/community/developer-guide/cpp-diagnostic-code.md +++ b/docs/zh-CN/community/developer-guide/cpp-diagnostic-code.md @@ -35,20 +35,20 @@ Clang-Tidy中可以做一些代码分析的配置,配置文件`.clang-tidy`在Do ### 在VSCODE中配置Clangd 首先需要安装clangd插件,然后在`settings.json`中编辑或者直接在首选项中更改插件配置。相比于vscode-cpptools,clangd可以为vscode提供更强大和准确的代码转跳,并且集成了clang-tidy的分析和快速修复功能。 +在使用之前,先编译一次`be(RELEASE)`和`be-ut(ASAN)`,以生成对应的`compile_commands.json`文件。 ```json "clangd.path": "ldb_toolchain/bin/clangd", //clangd的路径 "clangd.arguments": [ "--background-index", "--clang-tidy", //开启clang-tidy - "--compile-commands-dir=doris/be/build_RELEASE/", //会用到cmake生成的compile_commands.json,所以需要先编译一次生成该文件 + "--compile-commands-dir=doris/be/build_Release/", "--completion-style=detailed", "-j=5", //clangd分析文件的并行数 "--all-scopes-completion", "--pch-storage=memory", "--pretty", - "-log=verbose", "--query-driver=ldb_toolchain/bin/*" //编译器路径 ], - "clangd.trace": "/home/disk2/pxl/dev/baidu/bdg/doris/core/output/clangd-server.log" //clangd的日志路径,可以自己设定 + "clangd.trace": "output/clangd-server.log" ```