This is an automated email from the ASF dual-hosted git repository.

panxiaolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new e2ac06d6d6 [Chore](execution) change PipelineTaskState to enum class 
&& remove some row-based code (#17300)
e2ac06d6d6 is described below

commit e2ac06d6d6ed5f4f4b71fdc01333a63d0d67fc34
Author: Pxl <pxl...@qq.com>
AuthorDate: Wed Mar 8 12:41:15 2023 +0800

    [Chore](execution) change PipelineTaskState to enum class && remove some 
row-based code (#17300)
    
    
    1. change PipelineTaskState to enum class
    2. remove some row-based code on FoldConstantExecutor::_get_result
    3. reduce memcpy on minmax runtime filter function(Now we can guarantee 
that the input data is aligned)
    4. add Wunused-template check, and remove some unused function, change some 
static function to inline function.
---
 be/CMakeLists.txt                                  |  8 +++-
 be/src/common/signal_handler.h                     | 15 -------
 be/src/exprs/minmax_predicate.h                    |  5 +--
 be/src/geo/CMakeLists.txt                          |  2 +-
 be/src/glibc-compatibility/CMakeLists.txt          |  2 +-
 be/src/gutil/strings/split.cc                      | 31 -------------
 .../segment_v2/inverted_index_compound_reader.cpp  |  1 -
 be/src/pipeline/pipeline_task.cpp                  | 30 ++++++-------
 be/src/pipeline/pipeline_task.h                    |  4 +-
 be/src/pipeline/task_scheduler.cpp                 | 52 ++++++++++++----------
 be/src/runtime/fold_constant_executor.cpp          | 25 +++--------
 be/src/runtime/fold_constant_executor.h            |  1 -
 be/src/runtime/threadlocal.h                       |  2 +-
 be/src/util/async_io.h                             |  1 -
 be/src/util/debug_util.cpp                         | 13 ------
 be/src/util/perf_counters.cpp                      |  1 -
 .../aggregate_function_reader_first_last.h         |  4 +-
 .../vec/aggregate_functions/key_holder_helpers.h   |  4 +-
 be/src/vec/columns/column_object.cpp               |  1 -
 be/src/vec/columns/column_vector.cpp               |  4 +-
 be/src/vec/common/field_visitors.h                 | 38 ----------------
 be/src/vec/data_types/data_type_string.cpp         | 17 -------
 be/src/vec/functions/cast_type_to_either.h         |  2 +-
 be/src/vec/json/json_parser.h                      |  4 +-
 be/src/vec/runtime/vdatetime_value.h               |  1 -
 25 files changed, 73 insertions(+), 195 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 235f204364..6dd2687121 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -490,7 +490,13 @@ if (COMPILER_CLANG)
         message(FATAL_ERROR "Need Clang version at least 13")
     endif()
 
-    add_compile_options(-fcolor-diagnostics -Wpedantic)
+    add_compile_options(-fcolor-diagnostics 
+                        -Wpedantic
+                        -Wunused-template
+                        -Wunused-private-field
+                        -Wunused-property-ivar
+                        -Wunused-member-function
+                        -Wunused-macros)
     add_compile_options(-Wno-zero-length-array
                         -Wno-variadic-macros
                         -Wno-gnu-zero-variadic-macro-arguments
diff --git a/be/src/common/signal_handler.h b/be/src/common/signal_handler.h
index 52cc797140..c7b655cbea 100644
--- a/be/src/common/signal_handler.h
+++ b/be/src/common/signal_handler.h
@@ -216,21 +216,6 @@ public:
         cursor_ += i;
     }
 
-    // Formats "number" as hexadecimal number, and updates the internal
-    // cursor.  Padding will be added in front if needed.
-    void AppendHexWithPadding(uint64 number, int width) {
-        char* start = cursor_;
-        AppendString("0x");
-        AppendUint64(number, 16);
-        // Move to right and add padding in front if needed.
-        if (cursor_ < start + width) {
-            const int64 delta = start + width - cursor_;
-            std::copy(start, cursor_, start + delta);
-            std::fill(start, start + delta, ' ');
-            cursor_ = start + width;
-        }
-    }
-
 private:
     char* buffer_;
     char* cursor_;
diff --git a/be/src/exprs/minmax_predicate.h b/be/src/exprs/minmax_predicate.h
index 65d9ee005f..96ec0eeb02 100644
--- a/be/src/exprs/minmax_predicate.h
+++ b/be/src/exprs/minmax_predicate.h
@@ -41,7 +41,7 @@ template <class T>
 class MinMaxNumFunc : public MinMaxFuncBase {
 public:
     MinMaxNumFunc() = default;
-    ~MinMaxNumFunc() = default;
+    ~MinMaxNumFunc() override = default;
 
     void insert(const void* data) override {
         if (data == nullptr) {
@@ -52,9 +52,6 @@ public:
         if constexpr (std::is_same_v<T, DateTimeValue>) {
             reinterpret_cast<const 
vectorized::VecDateTimeValue*>(data)->convert_vec_dt_to_dt(
                     &val_data);
-        } else if constexpr (sizeof(T) >= sizeof(int128_t)) {
-            // use dereference operator on unalign address maybe lead 
segmentation fault
-            memcpy(&val_data, data, sizeof(T));
         } else {
             val_data = *reinterpret_cast<const T*>(data);
         }
diff --git a/be/src/geo/CMakeLists.txt b/be/src/geo/CMakeLists.txt
index 691f6e054d..1471a33eaf 100644
--- a/be/src/geo/CMakeLists.txt
+++ b/be/src/geo/CMakeLists.txt
@@ -33,7 +33,7 @@ include(CheckCXXCompilerFlag)
 set(WARNING_OPTION "-Wno-unused-but-set-variable")
 check_cxx_compiler_flag(${WARNING_OPTION} HAS_WARNING_OPTION)
 if (HAS_WARNING_OPTION)
-    target_compile_options(Geo PRIVATE ${WARNING_OPTION})
+    target_compile_options(Geo PRIVATE ${WARNING_OPTION} "-Wno-unused-macros")
 endif()
 
 add_custom_command(
diff --git a/be/src/glibc-compatibility/CMakeLists.txt 
b/be/src/glibc-compatibility/CMakeLists.txt
index e6a51d6348..2bc8602554 100644
--- a/be/src/glibc-compatibility/CMakeLists.txt
+++ b/be/src/glibc-compatibility/CMakeLists.txt
@@ -64,7 +64,7 @@ if (GLIBC_COMPATIBILITY)
     add_library(glibc-compatibility STATIC ${glibc_compatibility_sources})
 
     if (COMPILER_CLANG)
-        target_compile_options(glibc-compatibility PRIVATE 
-Wno-unused-command-line-argument -Wno-unused-but-set-variable)
+        target_compile_options(glibc-compatibility PRIVATE 
-Wno-unused-command-line-argument -Wno-unused-but-set-variable 
-Wno-unused-macros)
     elseif (COMPILER_GCC)
         target_compile_options(glibc-compatibility PRIVATE 
-Wno-unused-but-set-variable -Wno-unused-but-set-variable 
-Wno-implicit-fallthrough)
     endif ()
diff --git a/be/src/gutil/strings/split.cc b/be/src/gutil/strings/split.cc
index 846635e876..610b1ee7ea 100644
--- a/be/src/gutil/strings/split.cc
+++ b/be/src/gutil/strings/split.cc
@@ -257,37 +257,6 @@ void ClipString(string* full_str, int max_len) {
     }
 }
 
-// ----------------------------------------------------------------------
-// SplitStringToIteratorAllowEmpty()
-//    Split a string using a character delimiter. Append the components
-//    to 'result'.  If there are consecutive delimiters, this function
-//    will return corresponding empty strings. The string is split into
-//    at most the specified number of pieces greedily. This means that the
-//    last piece may possibly be split further. To split into as many pieces
-//    as possible, specify 0 as the number of pieces.
-//
-//    If "full" is the empty string, yields an empty string as the only value.
-//
-//    If "pieces" is negative for some reason, it returns the whole string
-// ----------------------------------------------------------------------
-template <typename StringType, typename ITR>
-static inline void SplitStringToIteratorAllowEmpty(const StringType& full, 
const char* delim,
-                                                   int pieces, ITR& result) {
-    string::size_type begin_index, end_index;
-    begin_index = 0;
-
-    for (int i = 0; (i < pieces - 1) || (pieces == 0); i++) {
-        end_index = full.find_first_of(delim, begin_index);
-        if (end_index == string::npos) {
-            *result++ = full.substr(begin_index);
-            return;
-        }
-        *result++ = full.substr(begin_index, (end_index - begin_index));
-        begin_index = end_index + 1;
-    }
-    *result++ = full.substr(begin_index);
-}
-
 void SplitStringIntoNPiecesAllowEmpty(const string& full, const char* delim, 
int pieces,
                                       vector<string>* result) {
     if (pieces == 0) {
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.cpp 
b/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.cpp
index 77ddf31e0e..358ad4bb50 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_compound_reader.cpp
@@ -21,7 +21,6 @@
 
 #define BUFFER_LENGTH 16384
 #define CL_MAX_PATH 4096
-#define CL_MAX_DIR CL_MAX_PATH
 
 #define STRDUP_WtoA(x) CL_NS(util)::Misc::_wideToChar(x)
 #define STRDUP_TtoA STRDUP_WtoA
diff --git a/be/src/pipeline/pipeline_task.cpp 
b/be/src/pipeline/pipeline_task.cpp
index 88bdfe724a..044d952c0e 100644
--- a/be/src/pipeline/pipeline_task.cpp
+++ b/be/src/pipeline/pipeline_task.cpp
@@ -53,7 +53,7 @@ void PipelineTask::_init_profile() {
 
 Status PipelineTask::prepare(RuntimeState* state) {
     DCHECK(_sink);
-    DCHECK(_cur_state == NOT_READY);
+    DCHECK(_cur_state == PipelineTaskState::NOT_READY);
     _init_profile();
     SCOPED_TIMER(_task_profile->total_time_counter());
     SCOPED_CPU_TIMER(_task_cpu_timer);
@@ -80,7 +80,7 @@ Status PipelineTask::prepare(RuntimeState* state) {
     _block.reset(new doris::vectorized::Block());
 
     // We should make sure initial state for task are runnable so that we can 
do some preparation jobs (e.g. initialize runtime filters).
-    set_state(RUNNABLE);
+    set_state(PipelineTaskState::RUNNABLE);
     _prepared = true;
     return Status::OK();
 }
@@ -133,32 +133,32 @@ Status PipelineTask::execute(bool* eos) {
             SCOPED_RAW_TIMER(&time_spent);
             auto st = open();
             if (st.is_blocked_by_rf()) {
-                set_state(BLOCKED_FOR_RF);
+                set_state(PipelineTaskState::BLOCKED_FOR_RF);
                 return Status::OK();
             }
             RETURN_IF_ERROR(st);
         }
         if (has_dependency()) {
-            set_state(BLOCKED_FOR_DEPENDENCY);
+            set_state(PipelineTaskState::BLOCKED_FOR_DEPENDENCY);
             return Status::OK();
         }
         if (!_source->can_read()) {
-            set_state(BLOCKED_FOR_SOURCE);
+            set_state(PipelineTaskState::BLOCKED_FOR_SOURCE);
             return Status::OK();
         }
         if (!_sink->can_write()) {
-            set_state(BLOCKED_FOR_SINK);
+            set_state(PipelineTaskState::BLOCKED_FOR_SINK);
             return Status::OK();
         }
     }
 
     while (!_fragment_context->is_canceled()) {
         if (_data_state != SourceState::MORE_DATA && !_source->can_read()) {
-            set_state(BLOCKED_FOR_SOURCE);
+            set_state(PipelineTaskState::BLOCKED_FOR_SOURCE);
             break;
         }
         if (!_sink->can_write()) {
-            set_state(BLOCKED_FOR_SINK);
+            set_state(PipelineTaskState::BLOCKED_FOR_SINK);
             break;
         }
         if (time_spent > THREAD_TIME_SLICE) {
@@ -232,20 +232,20 @@ void PipelineTask::set_state(PipelineTaskState state) {
     if (_cur_state == state) {
         return;
     }
-    if (_cur_state == BLOCKED_FOR_SOURCE) {
-        if (state == RUNNABLE) {
+    if (_cur_state == PipelineTaskState::BLOCKED_FOR_SOURCE) {
+        if (state == PipelineTaskState::RUNNABLE) {
             _wait_source_watcher.stop();
         }
-    } else if (_cur_state == BLOCKED_FOR_SINK) {
-        if (state == RUNNABLE) {
+    } else if (_cur_state == PipelineTaskState::BLOCKED_FOR_SINK) {
+        if (state == PipelineTaskState::RUNNABLE) {
             _wait_sink_watcher.stop();
         }
-    } else if (_cur_state == RUNNABLE) {
+    } else if (_cur_state == PipelineTaskState::RUNNABLE) {
         COUNTER_UPDATE(_block_counts, 1);
-        if (state == BLOCKED_FOR_SOURCE) {
+        if (state == PipelineTaskState::BLOCKED_FOR_SOURCE) {
             _wait_source_watcher.start();
             COUNTER_UPDATE(_block_by_source_counts, 1);
-        } else if (state == BLOCKED_FOR_SINK) {
+        } else if (state == PipelineTaskState::BLOCKED_FOR_SINK) {
             _wait_sink_watcher.start();
             COUNTER_UPDATE(_block_by_sink_counts, 1);
         }
diff --git a/be/src/pipeline/pipeline_task.h b/be/src/pipeline/pipeline_task.h
index a83bf8c3be..f7b0745ed8 100644
--- a/be/src/pipeline/pipeline_task.h
+++ b/be/src/pipeline/pipeline_task.h
@@ -48,7 +48,7 @@ namespace doris::pipeline {
  * transfer 8 (RUNNABLE -> FINISHED): this pipeline task completed and no 
resource need to be released
  * transfer 9 (RUNNABLE -> RUNNABLE): this pipeline task yields CPU and 
re-enters the runnable queue if it is runnable and has occupied CPU for a max 
time slice
  */
-enum PipelineTaskState : uint8_t {
+enum class PipelineTaskState : uint8_t {
     NOT_READY = 0, // do not prepare
     BLOCKED_FOR_DEPENDENCY = 1,
     BLOCKED_FOR_SOURCE = 2,
@@ -101,7 +101,7 @@ public:
               _opened(false),
               _can_steal(pipeline->_can_steal),
               _state(state),
-              _cur_state(NOT_READY),
+              _cur_state(PipelineTaskState::NOT_READY),
               _data_state(SourceState::DEPEND_ON_SOURCE),
               _fragment_context(fragment_context),
               _parent_profile(parent_profile) {}
diff --git a/be/src/pipeline/task_scheduler.cpp 
b/be/src/pipeline/task_scheduler.cpp
index bdf35b62af..9987fab5a4 100644
--- a/be/src/pipeline/task_scheduler.cpp
+++ b/be/src/pipeline/task_scheduler.cpp
@@ -88,16 +88,17 @@ void BlockedTaskScheduler::_schedule() {
         while (iter != local_blocked_tasks.end()) {
             auto* task = *iter;
             auto state = task->get_state();
-            if (state == PENDING_FINISH) {
+            if (state == PipelineTaskState::PENDING_FINISH) {
                 // should cancel or should finish
                 if (task->is_pending_finish()) {
                     iter++;
                 } else {
-                    _make_task_run(local_blocked_tasks, iter, ready_tasks, 
PENDING_FINISH);
+                    _make_task_run(local_blocked_tasks, iter, ready_tasks,
+                                   PipelineTaskState::PENDING_FINISH);
                 }
             } else if (task->fragment_context()->is_canceled()) {
                 if (task->is_pending_finish()) {
-                    task->set_state(PENDING_FINISH);
+                    task->set_state(PipelineTaskState::PENDING_FINISH);
                     iter++;
                 } else {
                     _make_task_run(local_blocked_tasks, iter, ready_tasks);
@@ -111,30 +112,30 @@ void BlockedTaskScheduler::_schedule() {
                 
task->fragment_context()->cancel(PPlanFragmentCancelReason::TIMEOUT);
 
                 if (task->is_pending_finish()) {
-                    task->set_state(PENDING_FINISH);
+                    task->set_state(PipelineTaskState::PENDING_FINISH);
                     iter++;
                 } else {
                     _make_task_run(local_blocked_tasks, iter, ready_tasks);
                 }
-            } else if (state == BLOCKED_FOR_DEPENDENCY) {
+            } else if (state == PipelineTaskState::BLOCKED_FOR_DEPENDENCY) {
                 if (task->has_dependency()) {
                     iter++;
                 } else {
                     _make_task_run(local_blocked_tasks, iter, ready_tasks);
                 }
-            } else if (state == BLOCKED_FOR_SOURCE) {
+            } else if (state == PipelineTaskState::BLOCKED_FOR_SOURCE) {
                 if (task->source_can_read()) {
                     _make_task_run(local_blocked_tasks, iter, ready_tasks);
                 } else {
                     iter++;
                 }
-            } else if (state == BLOCKED_FOR_RF) {
+            } else if (state == PipelineTaskState::BLOCKED_FOR_RF) {
                 if (task->runtime_filters_are_ready_or_timeout()) {
                     _make_task_run(local_blocked_tasks, iter, ready_tasks);
                 } else {
                     iter++;
                 }
-            } else if (state == BLOCKED_FOR_SINK) {
+            } else if (state == PipelineTaskState::BLOCKED_FOR_SINK) {
                 if (task->sink_can_write()) {
                     _make_task_run(local_blocked_tasks, iter, ready_tasks);
                 } else {
@@ -225,21 +226,24 @@ void TaskScheduler::_do_work(size_t index) {
         bool canceled = fragment_ctx->is_canceled();
 
         auto check_state = task->get_state();
-        if (check_state == PENDING_FINISH) {
+        if (check_state == PipelineTaskState::PENDING_FINISH) {
             DCHECK(!task->is_pending_finish()) << "must not pending close " << 
task->debug_string();
-            _try_close_task(task, canceled ? CANCELED : FINISHED);
+            _try_close_task(task,
+                            canceled ? PipelineTaskState::CANCELED : 
PipelineTaskState::FINISHED);
             continue;
         }
-        DCHECK(check_state != FINISHED && check_state != CANCELED) << "task 
already finish";
+        DCHECK(check_state != PipelineTaskState::FINISHED &&
+               check_state != PipelineTaskState::CANCELED)
+                << "task already finish";
 
         if (canceled) {
             // may change from pending FINISH,should called cancel
             // also may change form BLOCK, other task called cancel
-            _try_close_task(task, CANCELED);
+            _try_close_task(task, PipelineTaskState::CANCELED);
             continue;
         }
 
-        DCHECK(check_state == RUNNABLE);
+        DCHECK(check_state == PipelineTaskState::RUNNABLE);
         // task exec
         bool eos = false;
         auto status = task->execute(&eos);
@@ -250,7 +254,7 @@ void TaskScheduler::_do_work(size_t index) {
             // exec failed,cancel all fragment instance
             fragment_ctx->cancel(PPlanFragmentCancelReason::INTERNAL_ERROR, 
status.to_string());
             fragment_ctx->send_report(true);
-            _try_close_task(task, CANCELED);
+            _try_close_task(task, PipelineTaskState::CANCELED);
             continue;
         }
 
@@ -262,23 +266,23 @@ void TaskScheduler::_do_work(size_t index) {
                 // execute failed,cancel all fragment
                 fragment_ctx->cancel(PPlanFragmentCancelReason::INTERNAL_ERROR,
                                      "finalize fail:" + status.to_string());
-                _try_close_task(task, CANCELED);
+                _try_close_task(task, PipelineTaskState::CANCELED);
             } else {
                 task->finish_p_dependency();
-                _try_close_task(task, FINISHED);
+                _try_close_task(task, PipelineTaskState::FINISHED);
             }
             continue;
         }
 
         auto pipeline_state = task->get_state();
         switch (pipeline_state) {
-        case BLOCKED_FOR_SOURCE:
-        case BLOCKED_FOR_SINK:
-        case BLOCKED_FOR_RF:
-        case BLOCKED_FOR_DEPENDENCY:
+        case PipelineTaskState::BLOCKED_FOR_SOURCE:
+        case PipelineTaskState::BLOCKED_FOR_SINK:
+        case PipelineTaskState::BLOCKED_FOR_RF:
+        case PipelineTaskState::BLOCKED_FOR_DEPENDENCY:
             _blocked_task_scheduler->add_blocked_task(task);
             break;
-        case RUNNABLE:
+        case PipelineTaskState::RUNNABLE:
             queue->push_back(task, index);
             break;
         default:
@@ -292,7 +296,7 @@ void TaskScheduler::_try_close_task(PipelineTask* task, 
PipelineTaskState state)
     // state only should be CANCELED or FINISHED
     task->try_close();
     if (task->is_pending_finish()) {
-        task->set_state(PENDING_FINISH);
+        task->set_state(PipelineTaskState::PENDING_FINISH);
         _blocked_task_scheduler->add_blocked_task(task);
     } else {
         auto status = task->close();
@@ -300,13 +304,13 @@ void TaskScheduler::_try_close_task(PipelineTask* task, 
PipelineTaskState state)
             // TODO: LOG warning
         }
         if (task->is_pending_finish()) {
-            task->set_state(PENDING_FINISH);
+            task->set_state(PipelineTaskState::PENDING_FINISH);
             _blocked_task_scheduler->add_blocked_task(task);
             return;
         }
         task->set_state(state);
         // TODO: rethink the logic
-        if (state == CANCELED) {
+        if (state == PipelineTaskState::CANCELED) {
             task->finish_p_dependency();
         }
         task->fragment_context()->close_a_pipeline();
diff --git a/be/src/runtime/fold_constant_executor.cpp 
b/be/src/runtime/fold_constant_executor.cpp
index 1efd33238b..da99ddfd1e 100644
--- a/be/src/runtime/fold_constant_executor.cpp
+++ b/be/src/runtime/fold_constant_executor.cpp
@@ -83,8 +83,8 @@ Status FoldConstantExecutor::fold_constant_vexpr(const 
TFoldConstantParams& para
             } else {
                 expr_result.set_success(true);
                 auto string_ref = column_ptr->get_data_at(0);
-                result = _get_result<true>((void*)string_ref.data, 
string_ref.size,
-                                           ctx->root()->type(), column_ptr, 
column_type);
+                result = _get_result((void*)string_ref.data, string_ref.size, 
ctx->root()->type(),
+                                     column_ptr, column_type);
             }
 
             expr_result.set_content(std::move(result));
@@ -138,7 +138,6 @@ Status FoldConstantExecutor::_prepare_and_open(Context* 
ctx) {
     return ctx->open(_runtime_state.get());
 }
 
-template <bool is_vec>
 string FoldConstantExecutor::_get_result(void* src, size_t size, const 
TypeDescriptor& type,
                                          const vectorized::ColumnPtr 
column_ptr,
                                          const vectorized::DataTypePtr 
column_type) {
@@ -180,24 +179,14 @@ string FoldConstantExecutor::_get_result(void* src, 
size_t size, const TypeDescr
     case TYPE_STRING:
     case TYPE_HLL:
     case TYPE_OBJECT: {
-        if constexpr (is_vec) {
-            return std::string((char*)src, size);
-        }
-        return (reinterpret_cast<StringRef*>(src))->to_string();
+        return std::string((char*)src, size);
     }
     case TYPE_DATE:
     case TYPE_DATETIME: {
-        if constexpr (is_vec) {
-            auto date_value = 
reinterpret_cast<vectorized::VecDateTimeValue*>(src);
-            char str[MAX_DTVALUE_STR_LEN];
-            date_value->to_string(str);
-            return str;
-        } else {
-            const DateTimeValue date_value = 
*reinterpret_cast<DateTimeValue*>(src);
-            char str[MAX_DTVALUE_STR_LEN];
-            date_value.to_string(str);
-            return str;
-        }
+        auto date_value = reinterpret_cast<vectorized::VecDateTimeValue*>(src);
+        char str[MAX_DTVALUE_STR_LEN];
+        date_value->to_string(str);
+        return str;
     }
     case TYPE_DATEV2: {
         vectorized::DateV2Value<vectorized::DateV2ValueType> value =
diff --git a/be/src/runtime/fold_constant_executor.h 
b/be/src/runtime/fold_constant_executor.h
index 825a56de9d..edc1e4ada3 100644
--- a/be/src/runtime/fold_constant_executor.h
+++ b/be/src/runtime/fold_constant_executor.h
@@ -46,7 +46,6 @@ private:
     template <typename Context>
     Status _prepare_and_open(Context* ctx);
 
-    template <bool is_vec = false>
     std::string _get_result(void* src, size_t size, const TypeDescriptor& type,
                             const vectorized::ColumnPtr column_ptr,
                             const vectorized::DataTypePtr column_type);
diff --git a/be/src/runtime/threadlocal.h b/be/src/runtime/threadlocal.h
index 7f59c689bd..4abbf14371 100644
--- a/be/src/runtime/threadlocal.h
+++ b/be/src/runtime/threadlocal.h
@@ -119,7 +119,7 @@ void add_destructor(void (*destructor)(void*), void* arg);
 
 // Destroy the passed object of type T.
 template <class T>
-static void destroy(void* t) {
+void destroy(void* t) {
     // With tcmalloc, this should be pretty cheap (same thread as new).
     delete reinterpret_cast<T*>(t);
 }
diff --git a/be/src/util/async_io.h b/be/src/util/async_io.h
index f4e69eaf3b..6d324e4f2a 100644
--- a/be/src/util/async_io.h
+++ b/be/src/util/async_io.h
@@ -22,7 +22,6 @@
 #include "io/fs/file_system.h"
 #include "olap/olap_define.h"
 #include "priority_thread_pool.hpp"
-#include "runtime/threadlocal.h"
 
 namespace doris {
 
diff --git a/be/src/util/debug_util.cpp b/be/src/util/debug_util.cpp
index 936b32f0ff..9179c70a60 100644
--- a/be/src/util/debug_util.cpp
+++ b/be/src/util/debug_util.cpp
@@ -26,19 +26,6 @@
 #include "gen_cpp/version.h"
 #include "util/cpu_info.h"
 
-#define PRECISION 2
-#define KILOBYTE (1024)
-#define MEGABYTE (1024 * 1024)
-#define GIGABYTE (1024 * 1024 * 1024)
-
-#define SECOND (1000)
-#define MINUTE (1000 * 60)
-#define HOUR (1000 * 60 * 60)
-
-#define THOUSAND (1000)
-#define MILLION (THOUSAND * 1000)
-#define BILLION (MILLION * 1000)
-
 namespace doris {
 
 std::string print_plan_node_type(const TPlanNodeType::type& type) {
diff --git a/be/src/util/perf_counters.cpp b/be/src/util/perf_counters.cpp
index 8951fd3a20..d802cc77c8 100644
--- a/be/src/util/perf_counters.cpp
+++ b/be/src/util/perf_counters.cpp
@@ -41,7 +41,6 @@
 namespace doris {
 
 #define COUNTER_SIZE (sizeof(void*))
-#define BUFFER_SIZE 256
 #define PRETTY_PRINT_WIDTH 13
 
 static std::unordered_map<std::string, std::string> _process_state;
diff --git 
a/be/src/vec/aggregate_functions/aggregate_function_reader_first_last.h 
b/be/src/vec/aggregate_functions/aggregate_function_reader_first_last.h
index 362bf68a46..3cef76f9a2 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_reader_first_last.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_reader_first_last.h
@@ -237,8 +237,8 @@ private:
 
 template <template <typename> class AggregateFunctionTemplate, template 
<typename> class Impl,
           bool result_is_nullable, bool arg_is_nullable, bool is_copy = false>
-static IAggregateFunction* create_function_single_value(const String& name,
-                                                        const DataTypes& 
argument_types) {
+IAggregateFunction* create_function_single_value(const String& name,
+                                                 const DataTypes& 
argument_types) {
     auto type = remove_nullable(argument_types[0]);
     WhichDataType which(*type);
 
diff --git a/be/src/vec/aggregate_functions/key_holder_helpers.h 
b/be/src/vec/aggregate_functions/key_holder_helpers.h
index 33fb0c5167..e31ead7029 100644
--- a/be/src/vec/aggregate_functions/key_holder_helpers.h
+++ b/be/src/vec/aggregate_functions/key_holder_helpers.h
@@ -26,7 +26,7 @@
 namespace doris::vectorized {
 
 template <bool is_plain_column = false>
-static auto get_key_holder(const IColumn& column, size_t row_num, Arena& 
arena) {
+auto get_key_holder(const IColumn& column, size_t row_num, Arena& arena) {
     if constexpr (is_plain_column) {
         return ArenaKeyHolder {column.get_data_at(row_num), arena};
     } else {
@@ -38,7 +38,7 @@ static auto get_key_holder(const IColumn& column, size_t 
row_num, Arena& arena)
 }
 
 template <bool is_plain_column>
-static void deserialize_and_insert(StringRef str, IColumn& data_to) {
+void deserialize_and_insert(StringRef str, IColumn& data_to) {
     if constexpr (is_plain_column) {
         data_to.insert_data(str.data, str.size);
     } else {
diff --git a/be/src/vec/columns/column_object.cpp 
b/be/src/vec/columns/column_object.cpp
index 2dcbbcd615..aea732b102 100644
--- a/be/src/vec/columns/column_object.cpp
+++ b/be/src/vec/columns/column_object.cpp
@@ -212,7 +212,6 @@ public:
         have_nulls = true;
         return 0;
     }
-    size_t operator()(const Int128I& x) { LOG(FATAL) << "not implemented"; }
     template <typename T>
     size_t operator()(const T&) {
         Field::EnumToType<Field::Types::Array>::Type a;
diff --git a/be/src/vec/columns/column_vector.cpp 
b/be/src/vec/columns/column_vector.cpp
index 06c0a149ab..ee87fd0010 100644
--- a/be/src/vec/columns/column_vector.cpp
+++ b/be/src/vec/columns/column_vector.cpp
@@ -188,7 +188,9 @@ void 
ColumnVector<T>::update_crcs_with_value(std::vector<uint64_t>& hashes, Prim
                 }
             } else {
                 for (size_t i = 0; i < s; i++) {
-                    if (null_data[i] == 0) date_convert_do_crc(i);
+                    if (null_data[i] == 0) {
+                        date_convert_do_crc(i);
+                    }
                 }
             }
         } else {
diff --git a/be/src/vec/common/field_visitors.h 
b/be/src/vec/common/field_visitors.h
index cf777a447a..7a37499ff6 100644
--- a/be/src/vec/common/field_visitors.h
+++ b/be/src/vec/common/field_visitors.h
@@ -76,44 +76,6 @@ typename std::decay_t<Visitor>::ResultType 
apply_visitor(Visitor&& visitor, F&&
     }
 }
 
-template <typename Visitor, typename F1, typename F2>
-static typename std::decay_t<Visitor>::ResultType 
apply_binary_visitor_impl(Visitor&& visitor,
-                                                                            
F1&& field1,
-                                                                            
F2&& field2) {
-    switch (field2.getType()) {
-    case Field::Types::Null:
-        return visitor(field1, field2.template get<Null>());
-    case Field::Types::UInt64:
-        return visitor(field1, field2.template get<UInt64>());
-    case Field::Types::UInt128:
-        return visitor(field1, field2.template get<UInt128>());
-    case Field::Types::Int64:
-        return visitor(field1, field2.template get<Int64>());
-    case Field::Types::Float64:
-        return visitor(field1, field2.template get<Float64>());
-    case Field::Types::String:
-        return visitor(field1, field2.template get<String>());
-    case Field::Types::Array:
-        return visitor(field1, field2.template get<Array>());
-    case Field::Types::Tuple:
-        return visitor(field1, field2.template get<Tuple>());
-    case Field::Types::Decimal32:
-        return visitor(field1, field2.template get<DecimalField<Decimal32>>());
-    case Field::Types::Decimal64:
-        return visitor(field1, field2.template get<DecimalField<Decimal64>>());
-    case Field::Types::Decimal128:
-        return visitor(field1, field2.template 
get<DecimalField<Decimal128>>());
-    case Field::Types::Decimal128I:
-        return visitor(field1, field2.template 
get<DecimalField<Decimal128I>>());
-    case Field::Types::AggregateFunctionState:
-        return visitor(field1, field2.template 
get<AggregateFunctionStateData>());
-
-    default:
-        LOG(FATAL) << "Bad type of Field";
-        return {};
-    }
-}
-
 template <typename Visitor, typename F1, typename F2>
 typename std::decay_t<Visitor>::ResultType apply_visitor(Visitor&& visitor, 
F1&& field1,
                                                          F2&& field2) {
diff --git a/be/src/vec/data_types/data_type_string.cpp 
b/be/src/vec/data_types/data_type_string.cpp
index 2c79984b6e..31408a8c62 100644
--- a/be/src/vec/data_types/data_type_string.cpp
+++ b/be/src/vec/data_types/data_type_string.cpp
@@ -34,23 +34,6 @@
 
 namespace doris::vectorized {
 
-template <typename Reader>
-static inline void read(IColumn& column, Reader&& reader) {
-    ColumnString& column_string = assert_cast<ColumnString&>(column);
-    ColumnString::Chars& data = column_string.get_chars();
-    ColumnString::Offsets& offsets = column_string.get_offsets();
-    size_t old_chars_size = data.size();
-    size_t old_offsets_size = offsets.size();
-    try {
-        reader(data);
-        offsets.push_back(data.size());
-    } catch (...) {
-        offsets.resize_assume_reserved(old_offsets_size);
-        data.resize_assume_reserved(old_chars_size);
-        throw;
-    }
-}
-
 std::string DataTypeString::to_string(const IColumn& column, size_t row_num) 
const {
     auto result = check_column_const_set_readability(column, row_num);
     ColumnPtr ptr = result.first;
diff --git a/be/src/vec/functions/cast_type_to_either.h 
b/be/src/vec/functions/cast_type_to_either.h
index 3a7b3ec0d6..3dd884db27 100644
--- a/be/src/vec/functions/cast_type_to_either.h
+++ b/be/src/vec/functions/cast_type_to_either.h
@@ -27,7 +27,7 @@ namespace doris::vectorized {
 class IDataType;
 
 template <typename... Ts, typename F>
-static bool cast_type_to_either(const IDataType* type, F&& f) {
+bool cast_type_to_either(const IDataType* type, F&& f) {
     /// XXX can't use && here because gcc-7 complains about parentheses around 
&& within ||
     return ((typeid_cast<const Ts*>(type) ? f(*typeid_cast<const Ts*>(type)) : 
false) || ...);
 }
diff --git a/be/src/vec/json/json_parser.h b/be/src/vec/json/json_parser.h
index 5b4a6ac659..db728c2442 100644
--- a/be/src/vec/json/json_parser.h
+++ b/be/src/vec/json/json_parser.h
@@ -28,7 +28,7 @@
 namespace doris::vectorized {
 
 template <typename Element>
-static Field getValueAsField(const Element& element) {
+Field getValueAsField(const Element& element) {
     // bool will convert to type FiledType::UInt64
     if (element.isBool()) {
         return element.getBool();
@@ -53,7 +53,7 @@ static Field getValueAsField(const Element& element) {
 }
 
 template <typename Element>
-static std::string castValueAsString(const Element& element) {
+std::string castValueAsString(const Element& element) {
     if (element.isBool()) {
         return element.getBool() ? "1" : "0";
     }
diff --git a/be/src/vec/runtime/vdatetime_value.h 
b/be/src/vec/runtime/vdatetime_value.h
index a6f777536e..e778c86f17 100644
--- a/be/src/vec/runtime/vdatetime_value.h
+++ b/be/src/vec/runtime/vdatetime_value.h
@@ -32,7 +32,6 @@
 #include "util/timezone_utils.h"
 
 namespace doris {
-class DateTimeValue;
 
 namespace vectorized {
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to