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

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


The following commit(s) were added to refs/heads/master by this push:
     new cd73a6b  [chore] fix clang compile error (#7883)
cd73a6b is described below

commit cd73a6b84bf147816e9f02a8db50be5883fe7ae3
Author: Pxl <952130...@qq.com>
AuthorDate: Wed Jan 26 12:53:35 2022 +0800

    [chore] fix clang compile error (#7883)
---
 be/CMakeLists.txt                                         |  5 +++++
 be/src/olap/storage_engine.cpp                            | 10 +++++-----
 be/test/exprs/bitmap_function_test.cpp                    |  4 ++--
 be/test/olap/delta_writer_test.cpp                        |  7 +++++--
 be/test/olap/rowset/beta_rowset_test.cpp                  |  2 +-
 be/test/olap/rowset/rowset_converter_test.cpp             | 10 +++++-----
 be/test/olap/rowset/segment_v2/bitmap_index_test.cpp      |  5 +++--
 .../segment_v2/bloom_filter_index_reader_writer_test.cpp  |  2 +-
 .../olap/rowset/segment_v2/column_reader_writer_test.cpp  |  6 +++---
 .../olap/rowset/segment_v2/ordinal_page_index_test.cpp    |  5 +++--
 be/test/olap/rowset/segment_v2/segment_test.cpp           |  2 +-
 be/test/olap/rowset/segment_v2/zone_map_index_test.cpp    | 15 ++++++++++-----
 be/test/tools/benchmark_tool.cpp                          |  5 +++--
 run-be-ut.sh                                              | 10 +++++++++-
 14 files changed, 56 insertions(+), 32 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 4e919c5..b7cd148 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -350,6 +350,11 @@ if (COMPILER_GCC)
 endif ()
 
 if (COMPILER_CLANG)
+
+    if(MAKE_TEST STREQUAL "OFF")
+        add_compile_options(-Qunused-arguments)
+    endif()
+
     # TODO: Fix all these warnings
     add_compile_options(
         -Wno-address-of-packed-member
diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp
index 9de74cd..aa1af9c 100644
--- a/be/src/olap/storage_engine.cpp
+++ b/be/src/olap/storage_engine.cpp
@@ -570,11 +570,11 @@ void StorageEngine::stop() {
     THREAD_JOIN(_tablet_checkpoint_tasks_producer_thread);
 #undef THREAD_JOIN
 
-#define THREADS_JOIN(threads)           \
-    for (const auto thread : threads) { \
-        if (thread) {                   \
-            thread->join();             \
-        }                               \
+#define THREADS_JOIN(threads)            \
+    for (const auto& thread : threads) { \
+        if (thread) {                    \
+            thread->join();              \
+        }                                \
     }
 
     THREADS_JOIN(_path_gc_threads);
diff --git a/be/test/exprs/bitmap_function_test.cpp 
b/be/test/exprs/bitmap_function_test.cpp
index 346a841..d789164 100644
--- a/be/test/exprs/bitmap_function_test.cpp
+++ b/be/test/exprs/bitmap_function_test.cpp
@@ -854,7 +854,7 @@ TEST_F(BitmapFunctionsTest, bitmap_not) {
     expected = BigIntVal(0);
     ASSERT_EQ(expected, result);
 
-    bitmap1 = BitmapValue({1});
+    bitmap1 = BitmapValue(1);
     bitmap2 = BitmapValue({2, 1});
 
     bitmap_src = convert_bitmap_to_string(ctx, bitmap1);
@@ -1151,7 +1151,7 @@ TEST_F(BitmapFunctionsTest, sub_bitmap) {
     ASSERT_EQ(res, convert_bitmap_to_string(ctx, bitmap5));
 
     res = BitmapFunctions::sub_bitmap(ctx, bitmap_src, BigIntVal(-1), 
BigIntVal(2));
-    BitmapValue bitmap6({500});
+    BitmapValue bitmap6(500);
     ASSERT_EQ(res, convert_bitmap_to_string(ctx, bitmap6));
 
     res = BitmapFunctions::sub_bitmap(ctx, bitmap_src, BigIntVal(-7), 
BigIntVal(6));
diff --git a/be/test/olap/delta_writer_test.cpp 
b/be/test/olap/delta_writer_test.cpp
index c4eb7f9..159e9e7 100644
--- a/be/test/olap/delta_writer_test.cpp
+++ b/be/test/olap/delta_writer_test.cpp
@@ -438,7 +438,8 @@ TEST_F(TestDeltaWriter, write) {
         memcpy(var_ptr->ptr, "abcde", 5);
         var_ptr->len = 5;
 
-        DecimalV2Value decimal_value(1.1);
+        DecimalV2Value decimal_value;
+        decimal_value.assign_from_double(1.1);
         *(DecimalV2Value*)(tuple->get_slot(slots[9]->tuple_offset())) = 
decimal_value;
 
         *(int8_t*)(tuple->get_slot(slots[10]->tuple_offset())) = -127;
@@ -463,7 +464,9 @@ TEST_F(TestDeltaWriter, write) {
         memcpy(var_ptr->ptr, "abcde", 5);
         var_ptr->len = 5;
 
-        DecimalV2Value val_decimal(1.1);
+        DecimalV2Value val_decimal;
+        val_decimal.assign_from_double(1.1);
+
         *(DecimalV2Value*)(tuple->get_slot(slots[19]->tuple_offset())) = 
val_decimal;
 
         res = delta_writer->write(tuple);
diff --git a/be/test/olap/rowset/beta_rowset_test.cpp 
b/be/test/olap/rowset/beta_rowset_test.cpp
index 7f8190f..c3b11ef 100644
--- a/be/test/olap/rowset/beta_rowset_test.cpp
+++ b/be/test/olap/rowset/beta_rowset_test.cpp
@@ -353,7 +353,7 @@ TEST_F(BetaRowsetTest, BasicFunctionTest) {
 } // namespace doris
 
 int main(int argc, char** argv) {
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
     doris::SegmentLoader::create_global_instance(1000);
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
diff --git a/be/test/olap/rowset/rowset_converter_test.cpp 
b/be/test/olap/rowset/rowset_converter_test.cpp
index ca6feba..281afc6 100644
--- a/be/test/olap/rowset/rowset_converter_test.cpp
+++ b/be/test/olap/rowset/rowset_converter_test.cpp
@@ -239,12 +239,12 @@ void RowsetConverterTest::process(RowsetTypePB src_type, 
RowsetTypePB dst_type)
     schema_hash_path_desc.filepath = _schema_hash_path;
     if (dst_type == BETA_ROWSET) {
         ASSERT_EQ(OLAP_SUCCESS,
-                  
rowset_converter.convert_alpha_to_beta(src_rowset->rowset_meta(),
-                          schema_hash_path_desc, &dst_rowset_meta_pb));
+                  rowset_converter.convert_alpha_to_beta(
+                          src_rowset->rowset_meta(), schema_hash_path_desc, 
&dst_rowset_meta_pb));
     } else {
         ASSERT_EQ(OLAP_SUCCESS,
-                  
rowset_converter.convert_beta_to_alpha(src_rowset->rowset_meta(),
-                          schema_hash_path_desc, &dst_rowset_meta_pb));
+                  rowset_converter.convert_beta_to_alpha(
+                          src_rowset->rowset_meta(), schema_hash_path_desc, 
&dst_rowset_meta_pb));
     }
 
     ASSERT_EQ(dst_type, dst_rowset_meta_pb.rowset_type());
@@ -299,7 +299,7 @@ TEST_F(RowsetConverterTest, TestConvertBetaRowsetToAlpha) {
 } // namespace doris
 
 int main(int argc, char** argv) {
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
     doris::SegmentLoader::create_global_instance(1000);
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
diff --git a/be/test/olap/rowset/segment_v2/bitmap_index_test.cpp 
b/be/test/olap/rowset/segment_v2/bitmap_index_test.cpp
index be1a8e3..dafb8e8 100644
--- a/be/test/olap/rowset/segment_v2/bitmap_index_test.cpp
+++ b/be/test/olap/rowset/segment_v2/bitmap_index_test.cpp
@@ -66,7 +66,8 @@ void write_index_file(std::string& filename, const void* 
values, size_t value_co
     {
         std::unique_ptr<fs::WritableBlock> wblock;
         fs::CreateBlockOptions opts(filename);
-        
ASSERT_TRUE(fs::fs_util::block_manager(TStorageMedium::HDD)->create_block(opts, 
&wblock).ok());
+        ASSERT_TRUE(
+                
fs::fs_util::block_manager(TStorageMedium::HDD)->create_block(opts, 
&wblock).ok());
 
         std::unique_ptr<BitmapIndexWriter> writer;
         BitmapIndexWriter::create(type_info, &writer);
@@ -239,7 +240,7 @@ TEST_F(BitmapIndexTest, test_null) {
 } // namespace doris
 
 int main(int argc, char** argv) {
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
 }
diff --git 
a/be/test/olap/rowset/segment_v2/bloom_filter_index_reader_writer_test.cpp 
b/be/test/olap/rowset/segment_v2/bloom_filter_index_reader_writer_test.cpp
index 5a86835..9639c6b 100644
--- a/be/test/olap/rowset/segment_v2/bloom_filter_index_reader_writer_test.cpp
+++ b/be/test/olap/rowset/segment_v2/bloom_filter_index_reader_writer_test.cpp
@@ -291,7 +291,7 @@ TEST_F(BloomFilterIndexReaderWriterTest, test_decimal) {
 } // namespace doris
 
 int main(int argc, char** argv) {
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
 }
diff --git a/be/test/olap/rowset/segment_v2/column_reader_writer_test.cpp 
b/be/test/olap/rowset/segment_v2/column_reader_writer_test.cpp
index bbae3fc..10eaf63 100644
--- a/be/test/olap/rowset/segment_v2/column_reader_writer_test.cpp
+++ b/be/test/olap/rowset/segment_v2/column_reader_writer_test.cpp
@@ -33,9 +33,9 @@
 #include "runtime/mem_tracker.h"
 #include "test_util/test_util.h"
 #include "util/file_utils.h"
-#include "vec/data_types/data_type_number.h"
-#include "vec/data_types/data_type_nothing.h"
 #include "vec/core/types.h"
+#include "vec/data_types/data_type_nothing.h"
+#include "vec/data_types/data_type_number.h"
 
 using std::string;
 
@@ -802,7 +802,7 @@ TEST_F(ColumnReaderWriterTest, test_v_default_value) {
 } // namespace doris
 
 int main(int argc, char** argv) {
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
 }
diff --git a/be/test/olap/rowset/segment_v2/ordinal_page_index_test.cpp 
b/be/test/olap/rowset/segment_v2/ordinal_page_index_test.cpp
index 4802f3f..d69fd73 100644
--- a/be/test/olap/rowset/segment_v2/ordinal_page_index_test.cpp
+++ b/be/test/olap/rowset/segment_v2/ordinal_page_index_test.cpp
@@ -63,7 +63,8 @@ TEST_F(OrdinalPageIndexTest, normal) {
     {
         std::unique_ptr<fs::WritableBlock> wblock;
         fs::CreateBlockOptions opts(filename);
-        
ASSERT_TRUE(fs::fs_util::block_manager(TStorageMedium::HDD)->create_block(opts, 
&wblock).ok());
+        ASSERT_TRUE(
+                
fs::fs_util::block_manager(TStorageMedium::HDD)->create_block(opts, 
&wblock).ok());
 
         ASSERT_TRUE(builder.finish(wblock.get(), &index_meta).ok());
         ASSERT_EQ(ORDINAL_INDEX, index_meta.type());
@@ -160,7 +161,7 @@ TEST_F(OrdinalPageIndexTest, one_data_page) {
 } // namespace doris
 
 int main(int argc, char** argv) {
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
 }
diff --git a/be/test/olap/rowset/segment_v2/segment_test.cpp 
b/be/test/olap/rowset/segment_v2/segment_test.cpp
index 1f8f45d..b62b731 100644
--- a/be/test/olap/rowset/segment_v2/segment_test.cpp
+++ b/be/test/olap/rowset/segment_v2/segment_test.cpp
@@ -1164,7 +1164,7 @@ TEST_F(SegmentReaderWriterTest, 
TestBloomFilterIndexUniqueModel) {
 } // namespace doris
 
 int main(int argc, char** argv) {
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
     ::testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
 }
diff --git a/be/test/olap/rowset/segment_v2/zone_map_index_test.cpp 
b/be/test/olap/rowset/segment_v2/zone_map_index_test.cpp
index ce19c92..f88bb2c 100644
--- a/be/test/olap/rowset/segment_v2/zone_map_index_test.cpp
+++ b/be/test/olap/rowset/segment_v2/zone_map_index_test.cpp
@@ -15,7 +15,6 @@
 // specific language governing permissions and limitations
 // under the License.
 
-#include "common/config.h"
 #include "olap/rowset/segment_v2/zone_map_index.h"
 
 #include <gtest/gtest.h>
@@ -23,6 +22,7 @@
 #include <memory>
 #include <string>
 
+#include "common/config.h"
 #include "env/env.h"
 #include "olap/fs/block_manager.h"
 #include "olap/fs/fs_util.h"
@@ -75,7 +75,9 @@ public:
         {
             std::unique_ptr<fs::WritableBlock> wblock;
             fs::CreateBlockOptions opts(filename);
-            
ASSERT_TRUE(fs::fs_util::block_manager(TStorageMedium::HDD)->create_block(opts, 
&wblock).ok());
+            ASSERT_TRUE(fs::fs_util::block_manager(TStorageMedium::HDD)
+                                ->create_block(opts, &wblock)
+                                .ok());
             ASSERT_TRUE(builder.finish(wblock.get(), &index_meta).ok());
             ASSERT_EQ(ZONE_MAP_INDEX, index_meta.type());
             ASSERT_TRUE(wblock->close().ok());
@@ -119,7 +121,9 @@ public:
         {
             std::unique_ptr<fs::WritableBlock> wblock;
             fs::CreateBlockOptions opts(filename);
-            
ASSERT_TRUE(fs::fs_util::block_manager(TStorageMedium::HDD)->create_block(opts, 
&wblock).ok());
+            ASSERT_TRUE(fs::fs_util::block_manager(TStorageMedium::HDD)
+                                ->create_block(opts, &wblock)
+                                .ok());
             ASSERT_TRUE(builder.finish(wblock.get(), &index_meta).ok());
             ASSERT_EQ(ZONE_MAP_INDEX, index_meta.type());
             ASSERT_TRUE(wblock->close().ok());
@@ -169,7 +173,8 @@ TEST_F(ColumnZoneMapTest, NormalTestIntPage) {
     {
         std::unique_ptr<fs::WritableBlock> wblock;
         fs::CreateBlockOptions opts({filename});
-        
ASSERT_TRUE(fs::fs_util::block_manager(TStorageMedium::HDD)->create_block(opts, 
&wblock).ok());
+        ASSERT_TRUE(
+                
fs::fs_util::block_manager(TStorageMedium::HDD)->create_block(opts, 
&wblock).ok());
         ASSERT_TRUE(builder.finish(wblock.get(), &index_meta).ok());
         ASSERT_EQ(ZONE_MAP_INDEX, index_meta.type());
         ASSERT_TRUE(wblock->close().ok());
@@ -226,7 +231,7 @@ TEST_F(ColumnZoneMapTest, ZoneMapCut) {
 } // namespace doris
 
 int main(int argc, char** argv) {
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
     testing::InitGoogleTest(&argc, argv);
     return RUN_ALL_TESTS();
 }
diff --git a/be/test/tools/benchmark_tool.cpp b/be/test/tools/benchmark_tool.cpp
index 41932fb..80b4f2e 100644
--- a/be/test/tools/benchmark_tool.cpp
+++ b/be/test/tools/benchmark_tool.cpp
@@ -187,7 +187,8 @@ public:
             BinaryDictPageDecoder page_decoder(src.slice(), decoder_options);
             page_decoder.init();
 
-            page_decoder.set_dict_decoder(dict_page_decoder.get(), 
dict_start_offset_array, dict_len_array);
+            page_decoder.set_dict_decoder(dict_page_decoder.get(), 
dict_start_offset_array,
+                                          dict_len_array);
 
             //check values
             size_t num = page_start_ids[slice_index + 1] - 
page_start_ids[slice_index];
@@ -627,7 +628,7 @@ int main(int argc, char** argv) {
     gflags::SetUsageMessage(usage);
     google::ParseCommandLineFlags(&argc, &argv, true);
 
-    doris::StoragePageCache::create_global_cache(1 << 30, 0.1);
+    doris::StoragePageCache::create_global_cache(1 << 30, 10);
 
     doris::MultiBenchmark multi_bm;
     multi_bm.add_bm();
diff --git a/run-be-ut.sh b/run-be-ut.sh
index 39cb673..4cd603f 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -127,7 +127,7 @@ else
 fi
 
 cd ${CMAKE_BUILD_DIR}
-${CMAKE_CMD} -G "${GENERATOR}" ../ -DWITH_MYSQL=OFF -DMAKE_TEST=ON 
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
+${CMAKE_CMD} -DCMAKE_MAKE_PROGRAM="${BUILD_SYSTEM}" ../ -DWITH_MYSQL=OFF 
-DMAKE_TEST=ON -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
     -DGLIBC_COMPATIBILITY=${GLIBC_COMPATIBILITY} ${CMAKE_USE_CCACHE}
 ${BUILD_SYSTEM} -j ${PARALLEL} $RUN_FILE
 
@@ -153,6 +153,14 @@ mkdir -p $LOG_DIR
 mkdir -p ${UDF_RUNTIME_DIR}
 rm -f ${UDF_RUNTIME_DIR}/*
 
+# clean all gcda file
+
+gcda_files=`find ${DORIS_TEST_BINARY_DIR} -name "*gcda"`
+for gcda_file in ${gcda_files[@]}
+do
+    rm $gcda_file
+done
+
 export DORIS_TEST_BINARY_DIR=${DORIS_TEST_BINARY_DIR}/test/
 
 # prepare gtest output dir

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

Reply via email to