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 8731eea26e [Chore](clang) fix some build fail on clang15 (#12882)
8731eea26e is described below

commit 8731eea26e1b62f8a88ad7ff12b724d4ba629ff5
Author: Pxl <pxl...@qq.com>
AuthorDate: Mon Sep 26 23:13:28 2022 +0800

    [Chore](clang) fix some build fail on clang15 (#12882)
    
    remove unused variables
---
 be/CMakeLists.txt                                  | 7 ++++++-
 be/src/agent/task_worker_pool.cpp                  | 2 --
 be/src/exec/partitioned_hash_table.cc              | 6 +++---
 be/src/exprs/new_agg_fn_evaluator.cc               | 2 +-
 be/src/exprs/table_function/explode_json_array.cpp | 2 --
 be/src/olap/tablet.cpp                             | 4 ----
 be/src/olap/tablet_meta.cpp                        | 5 -----
 be/src/util/cgroup_util.cpp                        | 2 +-
 be/src/vec/exec/scan/new_odbc_scanner.cpp          | 2 +-
 be/src/vec/exec/vodbc_scan_node.cpp                | 2 +-
 be/src/vec/functions/function.cpp                  | 3 ---
 be/src/vec/functions/nullif.cpp                    | 2 --
 12 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index db3cc63d4d..115eca0ef5 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -436,7 +436,12 @@ endfunction()
 set(CUSTUM_LINKER_COMMAND "ld")
 # TODO: mold will link fail on thirdparty brpc now, waiting for investigation.
 # TRY_TO_CHANGE_LINKER("mold" "mold")
-TRY_TO_CHANGE_LINKER("lld" "LLD")
+
+# TODO: brpc will link fail on clang-15, need fix in the future.
+if (COMPILER_GCC OR CLANG_VERSION_MAJOR VERSION_LESS 15)
+    TRY_TO_CHANGE_LINKER("lld" "LLD")
+endif()
+
 TRY_TO_CHANGE_LINKER("gold" "GNU gold")
 if (NOT CUSTUM_LINKER_COMMAND STREQUAL "ld")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} 
-fuse-ld=${CUSTUM_LINKER_COMMAND}")
diff --git a/be/src/agent/task_worker_pool.cpp 
b/be/src/agent/task_worker_pool.cpp
index bb7e276b2d..91526dab9d 100644
--- a/be/src/agent/task_worker_pool.cpp
+++ b/be/src/agent/task_worker_pool.cpp
@@ -722,14 +722,12 @@ void 
TaskWorkerPool::_publish_version_worker_thread_callback() {
                     .error(status);
             finish_task_request.__set_error_tablet_ids(error_tablet_ids);
         } else {
-            int submit_tablets = 0;
             if (config::enable_quick_compaction && 
config::quick_compaction_batch_size > 0) {
                 for (int i = 0; i < succ_tablet_ids.size(); i++) {
                     TabletSharedPtr tablet =
                             
StorageEngine::instance()->tablet_manager()->get_tablet(
                                     succ_tablet_ids[i]);
                     if (tablet != nullptr) {
-                        submit_tablets++;
                         tablet->publised_count++;
                         if (tablet->publised_count % 
config::quick_compaction_batch_size == 0) {
                             
StorageEngine::instance()->submit_quick_compaction_task(tablet);
diff --git a/be/src/exec/partitioned_hash_table.cc 
b/be/src/exec/partitioned_hash_table.cc
index a662764907..83fe65d1b6 100644
--- a/be/src/exec/partitioned_hash_table.cc
+++ b/be/src/exec/partitioned_hash_table.cc
@@ -439,9 +439,9 @@ void PartitionedHashTable::Close() {
     const int64_t HEAVILY_USED = 1024 * 1024;
     // TODO: These statistics should go to the runtime profile as well.
     if ((num_buckets_ > LARGE_HT) || (num_probes_ > HEAVILY_USED)) 
VLOG_CRITICAL << PrintStats();
-    for (auto& data_page : data_pages_) allocator_->Free(move(data_page));
+    for (auto& data_page : data_pages_) allocator_->Free(std::move(data_page));
     data_pages_.clear();
-    if (bucket_allocation_ != nullptr) 
allocator_->Free(move(bucket_allocation_));
+    if (bucket_allocation_ != nullptr) 
allocator_->Free(std::move(bucket_allocation_));
 }
 
 Status PartitionedHashTable::CheckAndResize(uint64_t buckets_to_fill,
@@ -508,7 +508,7 @@ Status PartitionedHashTable::ResizeBuckets(int64_t 
num_buckets,
     }
 
     num_buckets_ = num_buckets;
-    allocator_->Free(move(bucket_allocation_));
+    allocator_->Free(std::move(bucket_allocation_));
     bucket_allocation_ = std::move(new_allocation);
     buckets_ = reinterpret_cast<Bucket*>(bucket_allocation_->data());
     *got_memory = true;
diff --git a/be/src/exprs/new_agg_fn_evaluator.cc 
b/be/src/exprs/new_agg_fn_evaluator.cc
index 1fe0f6e897..3ce6375dde 100644
--- a/be/src/exprs/new_agg_fn_evaluator.cc
+++ b/be/src/exprs/new_agg_fn_evaluator.cc
@@ -183,7 +183,7 @@ Status NewAggFnEvaluator::Open(RuntimeState* state) {
         ExprContext* eval = input_evals_[i];
         RETURN_IF_ERROR(eval->get_const_value(state, *(agg_fn_.get_child(i)), 
&constant_args[i]));
     }
-    agg_fn_ctx_->impl()->set_constant_args(move(constant_args));
+    agg_fn_ctx_->impl()->set_constant_args(std::move(constant_args));
     return Status::OK();
 }
 
diff --git a/be/src/exprs/table_function/explode_json_array.cpp 
b/be/src/exprs/table_function/explode_json_array.cpp
index 76c55ffd78..bbf106ea41 100644
--- a/be/src/exprs/table_function/explode_json_array.cpp
+++ b/be/src/exprs/table_function/explode_json_array.cpp
@@ -62,7 +62,6 @@ int ParsedData::set_output(ExplodeJsonArrayType type, 
rapidjson::Document& docum
         _backup_string.clear();
         _string_nulls.clear();
         int32_t wbytes = 0;
-        int i = 0;
         for (auto& v : document.GetArray()) {
             switch (v.GetType()) {
             case rapidjson::Type::kStringType:
@@ -107,7 +106,6 @@ int ParsedData::set_output(ExplodeJsonArrayType type, 
rapidjson::Document& docum
                 _string_nulls.push_back(true);
                 break;
             }
-            ++i;
         }
         // Must set _data_string at the end, so that we can
         // save the real addr of string in `_backup_string` to `_data_string`.
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 257c7a04dc..d0f71f4117 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -1970,7 +1970,6 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
     for (auto& seg : segments) {
         seg->load_pk_index_and_bf(); // We need index blocks to iterate
         auto pk_idx = seg->get_primary_key_index();
-        int cnt = 0;
         int total = pk_idx->num_rows();
         uint32_t row_id = 0;
         int32_t remaining = total;
@@ -2010,12 +2009,10 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
                     if (st.ok()) {
                         delete_bitmap->add({loc.rowset_id, loc.segment_id, 
dummy_version.first},
                                            loc.row_id);
-                        cnt++;
                         ++row_id;
                         continue;
                     } else if (st.is_already_exist()) {
                         delete_bitmap->add({rowset_id, seg->id(), 
dummy_version.first}, row_id);
-                        cnt++;
                         ++row_id;
                         continue;
                     }
@@ -2034,7 +2031,6 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
                     loc.row_id = row_id;
                 }
 
-                ++cnt;
                 ++row_id;
                 delete_bitmap->add({loc.rowset_id, loc.segment_id, 
dummy_version.first},
                                    loc.row_id);
diff --git a/be/src/olap/tablet_meta.cpp b/be/src/olap/tablet_meta.cpp
index 0fdc5fbe5e..005336ad03 100644
--- a/be/src/olap/tablet_meta.cpp
+++ b/be/src/olap/tablet_meta.cpp
@@ -140,7 +140,6 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t 
partition_id, int64_t tablet_id
 
     // set column information
     uint32_t col_ordinal = 0;
-    uint32_t key_count = 0;
     bool has_bf_columns = false;
     for (TColumn tcolumn : tablet_schema.columns) {
         ColumnPB* column = schema->add_column();
@@ -153,10 +152,6 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t 
partition_id, int64_t tablet_id
         col_ordinal++;
         init_column_from_tcolumn(unique_id, tcolumn, column);
 
-        if (column->is_key()) {
-            ++key_count;
-        }
-
         if (column->is_bf_column()) {
             has_bf_columns = true;
         }
diff --git a/be/src/util/cgroup_util.cpp b/be/src/util/cgroup_util.cpp
index ab7e164f0a..63b3f61e63 100644
--- a/be/src/util/cgroup_util.cpp
+++ b/be/src/util/cgroup_util.cpp
@@ -66,7 +66,7 @@ Status CGroupUtil::find_global_cgroup(const string& 
subsystem, string* path) {
         std::vector<string> subsystems = Split(fields[1], ",");
         auto it = std::find(subsystems.begin(), subsystems.end(), subsystem);
         if (it != subsystems.end()) {
-            *path = move(fields[2]);
+            *path = std::move(fields[2]);
             return Status::OK();
         }
     }
diff --git a/be/src/vec/exec/scan/new_odbc_scanner.cpp 
b/be/src/vec/exec/scan/new_odbc_scanner.cpp
index 11943d8f04..118c35b76c 100644
--- a/be/src/vec/exec/scan/new_odbc_scanner.cpp
+++ b/be/src/vec/exec/scan/new_odbc_scanner.cpp
@@ -133,7 +133,7 @@ Status NewOdbcScanner::_get_block_impl(RuntimeState* state, 
Block* block, bool*
             }
         }
 
-        for (int row_index = 0; true; row_index++) {
+        while (true) {
             // block is full, break
             if (state->batch_size() <= columns[0]->size()) {
                 break;
diff --git a/be/src/vec/exec/vodbc_scan_node.cpp 
b/be/src/vec/exec/vodbc_scan_node.cpp
index d5a5bd0ec3..7bdc44501f 100644
--- a/be/src/vec/exec/vodbc_scan_node.cpp
+++ b/be/src/vec/exec/vodbc_scan_node.cpp
@@ -146,7 +146,7 @@ Status VOdbcScanNode::get_next(RuntimeState* state, Block* 
block, bool* eos) {
             }
         }
 
-        for (int row_index = 0; true; row_index++) {
+        while (true) {
             // block is full, break
             if (state->batch_size() <= columns[0]->size()) {
                 break;
diff --git a/be/src/vec/functions/function.cpp 
b/be/src/vec/functions/function.cpp
index cb53206e37..41f3141c06 100644
--- a/be/src/vec/functions/function.cpp
+++ b/be/src/vec/functions/function.cpp
@@ -310,15 +310,12 @@ DataTypePtr 
FunctionBuilderImpl::get_return_type_without_low_cardinality(
 
 DataTypePtr FunctionBuilderImpl::get_return_type(const ColumnsWithTypeAndName& 
arguments) const {
     if (use_default_implementation_for_low_cardinality_columns()) {
-        size_t num_full_ordinary_columns = 0;
-
         ColumnsWithTypeAndName args_without_low_cardinality(arguments);
 
         for (ColumnWithTypeAndName& arg : args_without_low_cardinality) {
             bool is_const = arg.column && is_column_const(*arg.column);
             if (is_const)
                 arg.column = assert_cast<const 
ColumnConst&>(*arg.column).remove_low_cardinality();
-            if (!is_const) ++num_full_ordinary_columns;
         }
 
         auto type_without_low_cardinality =
diff --git a/be/src/vec/functions/nullif.cpp b/be/src/vec/functions/nullif.cpp
index 9b1da5939c..d2e1aaf25a 100644
--- a/be/src/vec/functions/nullif.cpp
+++ b/be/src/vec/functions/nullif.cpp
@@ -65,14 +65,12 @@ public:
     }
 
     DataTypePtr get_return_type_for_equal(const ColumnsWithTypeAndName& 
arguments) const {
-        size_t num_full_ordinary_columns = 0;
         ColumnsWithTypeAndName args_without_low_cardinality(arguments);
 
         for (ColumnWithTypeAndName& arg : args_without_low_cardinality) {
             bool is_const = arg.column && is_column_const(*arg.column);
             if (is_const)
                 arg.column = assert_cast<const 
ColumnConst&>(*arg.column).remove_low_cardinality();
-            if (!is_const) ++num_full_ordinary_columns;
         }
 
         if (!arguments.empty()) {


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

Reply via email to