You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/03/01 03:22:01 UTC

[incubator-doris] branch dev-1.0.0 updated (699d065 -> 2be9380)

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

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


    from 699d065  [fix](olap) add check statement to protect get_dict_word_info() from crash (#8241)
     new dfb0076  [improvement](lateral-view) Add number rows filtered in profile (#8251)
     new 2efcbfa  [fix](be-ut) fix bitmap_ut result wrong && fix schema_change compile error (#8261)
     new 3c872f2  [refactor] remove unused new_in_predicate code (#8263)
     new 2be9380  [fix][chore](insert)(fe) Fix analysis error of insert stmt and modify grpc-netty dependency (#8265)

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 be/src/common/daemon.cpp                           |   2 -
 be/src/exec/table_function_node.cpp                |   8 +-
 be/src/exec/table_function_node.h                  |   3 +
 be/src/exprs/CMakeLists.txt                        |   1 -
 be/src/exprs/new_in_predicate.cpp                  | 185 -----------
 be/src/exprs/new_in_predicate.h                    | 348 ---------------------
 be/src/exprs/table_function/explode_bitmap.cpp     |   4 +-
 be/src/exprs/table_function/explode_json_array.cpp |  14 +
 be/src/exprs/table_function/explode_split.cpp      |   1 +
 be/src/exprs/table_function/table_function.h       |   1 +
 be/test/olap/schema_change_test.cpp                |  96 +++---
 be/test/vec/function/function_bitmap_test.cpp      |  39 +--
 fe/fe-core/pom.xml                                 |   2 +-
 .../apache/doris/analysis/CreateFunctionStmt.java  |   2 +-
 .../java/org/apache/doris/analysis/InsertStmt.java |   4 +-
 .../org/apache/doris/rpc/BackendServiceClient.java |   2 +-
 .../org/apache/doris/planner/QueryPlanTest.java    |  62 ++--
 fe/pom.xml                                         |   2 +-
 18 files changed, 147 insertions(+), 629 deletions(-)
 delete mode 100644 be/src/exprs/new_in_predicate.cpp
 delete mode 100644 be/src/exprs/new_in_predicate.h

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


[incubator-doris] 01/04: [improvement](lateral-view) Add number rows filtered in profile (#8251)

Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit dfb0076ac04e6b66a861a868a351a0ae4500fe11
Author: Mingyu Chen <mo...@gmail.com>
AuthorDate: Tue Mar 1 11:04:57 2022 +0800

    [improvement](lateral-view) Add number rows filtered in profile (#8251)
    
    Add `RowsFiltered` counter in TableFunctionNode profile.
    So that we can know the total number of rows that TableFunctionNode processed
---
 be/src/exec/table_function_node.cpp                |  8 +++++++-
 be/src/exec/table_function_node.h                  |  3 +++
 be/src/exprs/table_function/explode_bitmap.cpp     |  4 +++-
 be/src/exprs/table_function/explode_json_array.cpp | 14 ++++++++++++++
 be/src/exprs/table_function/explode_split.cpp      |  1 +
 be/src/exprs/table_function/table_function.h       |  1 +
 6 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/be/src/exec/table_function_node.cpp b/be/src/exec/table_function_node.cpp
index 6eac8eb..8829c79 100644
--- a/be/src/exec/table_function_node.cpp
+++ b/be/src/exec/table_function_node.cpp
@@ -81,7 +81,9 @@ Status TableFunctionNode::_prepare_output_slot_ids(const TPlanNode& tnode) {
 
 Status TableFunctionNode::prepare(RuntimeState* state) {
     RETURN_IF_ERROR(ExecNode::prepare(state));
-    
+
+    _num_rows_filtered_counter = ADD_COUNTER(_runtime_profile, "RowsFiltered", TUnit::UNIT);
+ 
     RETURN_IF_ERROR(Expr::prepare(_fn_ctxs, state, _row_descriptor, expr_mem_tracker()));
     for (auto fn : _fns) {
         RETURN_IF_ERROR(fn->prepare());
@@ -303,6 +305,7 @@ Status TableFunctionNode::get_next(RuntimeState* state, RowBatch* row_batch, boo
                 ++_num_rows_returned;
             } else {
                 tuple_ptr = pre_tuple_ptr;
+                ++_num_rows_filtered;
             }
 
             // Forward after write success.
@@ -340,6 +343,9 @@ Status TableFunctionNode::close(RuntimeState* state) {
     }
     RETURN_IF_ERROR(exec_debug_action(TExecNodePhase::CLOSE));
     Expr::close(_fn_ctxs, state);
+
+    COUNTER_SET(_num_rows_filtered_counter, static_cast<int64_t>(_num_rows_filtered));
+
     return ExecNode::close(state);
 }
 
diff --git a/be/src/exec/table_function_node.h b/be/src/exec/table_function_node.h
index daf4d91..0e59790 100644
--- a/be/src/exec/table_function_node.h
+++ b/be/src/exec/table_function_node.h
@@ -74,6 +74,9 @@ private:
     std::vector<int> _child_slot_sizes;
     // indicate if child node reach the end
     bool _child_eos = false;
+
+    RuntimeProfile::Counter* _num_rows_filtered_counter = nullptr;
+    uint64_t _num_rows_filtered = 0;
 };
 
 }; // namespace doris
diff --git a/be/src/exprs/table_function/explode_bitmap.cpp b/be/src/exprs/table_function/explode_bitmap.cpp
index 1d1ca4d..3b5518b 100644
--- a/be/src/exprs/table_function/explode_bitmap.cpp
+++ b/be/src/exprs/table_function/explode_bitmap.cpp
@@ -22,7 +22,9 @@
 
 namespace doris {
 
-ExplodeBitmapTableFunction::ExplodeBitmapTableFunction() {}
+ExplodeBitmapTableFunction::ExplodeBitmapTableFunction() {
+    _fn_name = "explode_bitmap";
+}
 
 ExplodeBitmapTableFunction::~ExplodeBitmapTableFunction() {
     if (_cur_iter != nullptr) {
diff --git a/be/src/exprs/table_function/explode_json_array.cpp b/be/src/exprs/table_function/explode_json_array.cpp
index 43fb1f3..59db64e 100644
--- a/be/src/exprs/table_function/explode_json_array.cpp
+++ b/be/src/exprs/table_function/explode_json_array.cpp
@@ -128,6 +128,20 @@ int ParsedData::set_output(ExplodeJsonArrayType type, rapidjson::Document& docum
 ExplodeJsonArrayTableFunction::ExplodeJsonArrayTableFunction(ExplodeJsonArrayType type)
     : _type(type) {
     
+    switch (type) {
+        case ExplodeJsonArrayType::INT:
+            _fn_name = "explode_json_array_int";
+            break;
+        case ExplodeJsonArrayType::DOUBLE:
+            _fn_name = "explode_json_array_double";
+            break;
+        case ExplodeJsonArrayType::STRING:
+            _fn_name = "explode_json_array_string";
+            break;
+        default:
+            _fn_name = "unknown";
+            break;
+    }
 }
 
 ExplodeJsonArrayTableFunction::~ExplodeJsonArrayTableFunction() {
diff --git a/be/src/exprs/table_function/explode_split.cpp b/be/src/exprs/table_function/explode_split.cpp
index b1a0fe7..fa576dc 100644
--- a/be/src/exprs/table_function/explode_split.cpp
+++ b/be/src/exprs/table_function/explode_split.cpp
@@ -24,6 +24,7 @@
 namespace doris {
 
 ExplodeSplitTableFunction::ExplodeSplitTableFunction() {
+    _fn_name = "explode_split";
 }
 
 ExplodeSplitTableFunction::~ExplodeSplitTableFunction() {
diff --git a/be/src/exprs/table_function/table_function.h b/be/src/exprs/table_function/table_function.h
index a2b8b00..9671e6b 100644
--- a/be/src/exprs/table_function/table_function.h
+++ b/be/src/exprs/table_function/table_function.h
@@ -42,6 +42,7 @@ public:
     virtual Status forward(bool *eos) = 0;
 
 public:
+    std::string name() const { return _fn_name; }
     bool eos() const { return _eos; }
 
     void set_expr_context(ExprContext* expr_context) {

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


[incubator-doris] 04/04: [fix][chore](insert)(fe) Fix analysis error of insert stmt and modify grpc-netty dependency (#8265)

Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2be9380508085051881b3617546f0ac992dedd47
Author: Mingyu Chen <mo...@gmail.com>
AuthorDate: Tue Mar 1 11:12:10 2022 +0800

    [fix][chore](insert)(fe) Fix analysis error of insert stmt and modify grpc-netty dependency (#8265)
    
    This bug is introduced from #8112.
    
    Also , I change the `grpc-netty` dependency to `grpc-netty-shaded`, to avoid dependency conflict:
    ```
    java.lang.NoSuchMethodError: io.netty.buffer.PooledByteBufAllocator.
    ```
---
 fe/fe-core/pom.xml                                 |  2 +-
 .../apache/doris/analysis/CreateFunctionStmt.java  |  2 +-
 .../java/org/apache/doris/analysis/InsertStmt.java |  4 +-
 .../org/apache/doris/rpc/BackendServiceClient.java |  2 +-
 .../org/apache/doris/planner/QueryPlanTest.java    | 62 ++++++++++++++--------
 fe/pom.xml                                         |  2 +-
 6 files changed, 48 insertions(+), 26 deletions(-)

diff --git a/fe/fe-core/pom.xml b/fe/fe-core/pom.xml
index 9b11108..10aa192 100644
--- a/fe/fe-core/pom.xml
+++ b/fe/fe-core/pom.xml
@@ -560,7 +560,7 @@ under the License.
         </dependency>
         <dependency>
             <groupId>io.grpc</groupId>
-            <artifactId>grpc-netty</artifactId>
+            <artifactId>grpc-netty-shaded</artifactId>
         </dependency>
         <dependency>
             <groupId>io.grpc</groupId>
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateFunctionStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateFunctionStmt.java
index df609a9..6a5c18d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateFunctionStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateFunctionStmt.java
@@ -55,7 +55,7 @@ import java.util.List;
 import java.util.Map;
 
 import io.grpc.ManagedChannel;
-import io.grpc.netty.NettyChannelBuilder;
+import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
 
 // create a user define function
 public class CreateFunctionStmt extends DdlStmt {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java
index f750749..cfb4ecf 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java
@@ -511,7 +511,9 @@ public class InsertStmt extends DdlStmt {
             } else {
                 // INSERT INTO SELECT 1,2,3 ...
                 List<ArrayList<Expr>> rows = Lists.newArrayList();
-                rows.add(selectStmt.getResultExprs());
+                // ATTN: must copy the `selectStmt.getResultExprs()`, otherwise the following
+                // `selectStmt.getResultExprs().clear();` will clear the `rows` too, causing error.
+                rows.add(Lists.newArrayList(selectStmt.getResultExprs()));
                 analyzeRow(analyzer, targetColumns, rows, 0, origColIdxsForExtendCols);
                 // rows may be changed in analyzeRow(), so rebuild the result exprs
                 selectStmt.getResultExprs().clear();
diff --git a/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java b/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java
index 370f425..7330904 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java
@@ -29,7 +29,7 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
 import io.grpc.ManagedChannel;
-import io.grpc.netty.NettyChannelBuilder;
+import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder;
 
 public class BackendServiceClient {
     public static final Logger LOG = LogManager.getLogger(BackendServiceClient.class);
diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
index 94417eb..8626eda 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
@@ -432,21 +432,6 @@ public class QueryPlanTest {
                 "PROPERTIES (\n" +
                 "\"replication_num\" = \"1\"" +
                 ");");
-
-        createTable("CREATE TABLE test.result_exprs (\n" +
-                "  `aid` int(11) NULL,\n" +
-                "  `bid` int(11) NULL\n" +
-                ") ENGINE=OLAP\n" +
-                "DUPLICATE KEY(`aid`)\n" +
-                "COMMENT \"OLAP\"\n" +
-                "DISTRIBUTED BY HASH(`aid`) BUCKETS 7\n" +
-                "PROPERTIES (\n" +
-                "\"replication_num\" = \"1\",\n" +
-                "\"in_memory\" = \"false\",\n" +
-                "\"business_key_column_name\" = \"\",\n" +
-                "\"storage_medium\" = \"HDD\",\n" +
-                "\"storage_format\" = \"V2\"\n" +
-                ");\n");
     }
 
     @AfterClass
@@ -2028,13 +2013,14 @@ public class QueryPlanTest {
     @Test
     public void testQueryWithUsingClause() throws Exception {
         connectContext.setDatabase("default_cluster:test");
-        String iSql1 = "insert into test.tbl_using_a values(1,3,7),(2,2,8),(3,1,9)";
-        String iSql2 = "insert into test.tbl_using_b values(1,3,1),(3,1,1),(4,1,1),(5,2,1)";
-        UtFrameUtils.getSqlStmtExecutor(connectContext, iSql1);
-        UtFrameUtils.getSqlStmtExecutor(connectContext, iSql2);
-        String qSQL = "select t1.* from test.tbl_using_a t1 join test.tbl_using_b t2 using(k1,k2) where t1.k1 between 1 and 3 and t2.k3 between 1+0 and 3+0";
+        String iSql1 = "explain insert into test.tbl_using_a values(1,3,7),(2,2,8),(3,1,9)";
+        String iSql2 = "explain insert into test.tbl_using_b values(1,3,1),(3,1,1),(4,1,1),(5,2,1)";
+        UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, iSql1);
+        UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, iSql2);
+        String qSQL = "explain  select t1.* from test.tbl_using_a t1 join test.tbl_using_b t2 using(k1,k2) where t1.k1 " +
+                "between 1 and 3 and t2.k3 between 1+0 and 3+0";
         try {
-            UtFrameUtils.getSqlStmtExecutor(connectContext, qSQL);
+            UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, qSQL);
         } catch (AnalysisException e) {
             Assert.fail();
         }
@@ -2043,6 +2029,20 @@ public class QueryPlanTest {
     @Test
     public void testResultExprs() throws Exception {
         connectContext.setDatabase("default_cluster:test");
+        createTable("CREATE TABLE test.result_exprs (\n" +
+                "  `aid` int(11) NULL,\n" +
+                "  `bid` int(11) NULL\n" +
+                ") ENGINE=OLAP\n" +
+                "DUPLICATE KEY(`aid`)\n" +
+                "COMMENT \"OLAP\"\n" +
+                "DISTRIBUTED BY HASH(`aid`) BUCKETS 7\n" +
+                "PROPERTIES (\n" +
+                "\"replication_num\" = \"1\",\n" +
+                "\"in_memory\" = \"false\",\n" +
+                "\"business_key_column_name\" = \"\",\n" +
+                "\"storage_medium\" = \"HDD\",\n" +
+                "\"storage_format\" = \"V2\"\n" +
+                ");\n");
         String queryStr = "EXPLAIN INSERT INTO result_exprs\n" +
                 "SELECT a.aid,\n" +
                 "       b.bid\n" +
@@ -2054,4 +2054,24 @@ public class QueryPlanTest {
         Assert.assertFalse(explainString.contains("OUTPUT EXPRS:3 | 4"));
         Assert.assertTrue(explainString.contains("OUTPUT EXPRS:CAST(`a`.`aid` AS INT) | 4"));
     }
+
+    @Test
+    public void testInsertIntoSelect() throws Exception {
+        connectContext.setDatabase("default_cluster:test");
+        createTable("CREATE TABLE test.`decimal_tb` (\n" +
+                "  `k1` decimal(1, 0) NULL COMMENT \"\",\n" +
+                "  `v1` decimal(1, 0) SUM NULL COMMENT \"\",\n" +
+                "  `v2` decimal(1, 0) MAX NULL COMMENT \"\",\n" +
+                "  `v3` decimal(1, 0) MIN NULL COMMENT \"\",\n" +
+                "  `v4` decimal(1, 0) REPLACE NULL COMMENT \"\"\n" +
+                ") ENGINE=OLAP\n" +
+                "AGGREGATE KEY(`k1`)\n" +
+                "DISTRIBUTED BY HASH(`k1`) BUCKETS 1\n" +
+                "PROPERTIES (\n" +
+                "\"replication_allocation\" = \"tag.location.default: 1\"\n" +
+                ")");
+        String sql = "explain insert into test.decimal_tb select 1, 10, 1, 1, 1;";
+        String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, sql);
+        Assert.assertTrue(explainString.contains("1 | 10 | 1 | 1 | 1"));
+    }
 }
diff --git a/fe/pom.xml b/fe/pom.xml
index 80b7bef..8e62275 100644
--- a/fe/pom.xml
+++ b/fe/pom.xml
@@ -391,7 +391,7 @@ under the License.
             </dependency>
             <dependency>
                 <groupId>io.grpc</groupId>
-                <artifactId>grpc-netty</artifactId>
+                <artifactId>grpc-netty-shaded</artifactId>
                 <version>${grpc.version}</version>
                 <scope>provided</scope>
             </dependency>

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


[incubator-doris] 03/04: [refactor] remove unused new_in_predicate code (#8263)

Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3c872f2fccbe25db3e98137c49bb2271dda19d24
Author: Zhengguo Yang <ya...@gmail.com>
AuthorDate: Tue Mar 1 11:11:42 2022 +0800

    [refactor] remove unused new_in_predicate code (#8263)
    
    remove unused code of new_in_predicate.h/cpp
---
 be/src/common/daemon.cpp          |   2 -
 be/src/exprs/CMakeLists.txt       |   1 -
 be/src/exprs/new_in_predicate.cpp | 185 --------------------
 be/src/exprs/new_in_predicate.h   | 348 --------------------------------------
 4 files changed, 536 deletions(-)

diff --git a/be/src/common/daemon.cpp b/be/src/common/daemon.cpp
index 044feda..04625e3 100644
--- a/be/src/common/daemon.cpp
+++ b/be/src/common/daemon.cpp
@@ -37,7 +37,6 @@
 #include "exprs/json_functions.h"
 #include "exprs/like_predicate.h"
 #include "exprs/math_functions.h"
-#include "exprs/new_in_predicate.h"
 #include "exprs/operators.h"
 #include "exprs/string_functions.h"
 #include "exprs/table_function/dummy_table_functions.h"
@@ -250,7 +249,6 @@ void Daemon::init(int argc, char** argv, const std::vector<StorePath>& paths) {
     StringFunctions::init();
     ArrayFunctions::init();
     CastFunctions::init();
-    InPredicate::init();
     MathFunctions::init();
     EncryptionFunctions::init();
     TimestampFunctions::init();
diff --git a/be/src/exprs/CMakeLists.txt b/be/src/exprs/CMakeLists.txt
index c71f23e..f266fd9 100644
--- a/be/src/exprs/CMakeLists.txt
+++ b/be/src/exprs/CMakeLists.txt
@@ -41,7 +41,6 @@ add_library(Exprs
   expr.cpp
   expr_context.cpp
   in_predicate.cpp
-  new_in_predicate.cpp
   bloomfilter_predicate.cpp
   block_bloom_filter_avx_impl.cc
   block_bloom_filter_impl.cc
diff --git a/be/src/exprs/new_in_predicate.cpp b/be/src/exprs/new_in_predicate.cpp
deleted file mode 100644
index b0a6390..0000000
--- a/be/src/exprs/new_in_predicate.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#include "exprs/new_in_predicate.h"
-
-#include <sstream>
-
-#include "exprs/anyval_util.h"
-#include "runtime/string_value.hpp"
-
-namespace doris {
-
-void InPredicate::init() {}
-
-// Templated getter functions for extracting 'SetType' values from AnyVals
-template <typename T, typename SetType>
-SetType get_val(const FunctionContext::TypeDesc* type, const T& x) {
-    DCHECK(!x.is_null);
-    return x.val;
-}
-
-template <>
-StringValue get_val(const FunctionContext::TypeDesc* type, const StringVal& x) {
-    DCHECK(!x.is_null);
-    return StringValue::from_string_val(x);
-}
-
-template <>
-DateTimeValue get_val(const FunctionContext::TypeDesc* type, const DateTimeVal& x) {
-    return DateTimeValue::from_datetime_val(x);
-}
-
-template <>
-DecimalV2Value get_val(const FunctionContext::TypeDesc* type, const DecimalV2Val& x) {
-    return DecimalV2Value::from_decimal_val(x);
-}
-
-template <typename T, typename SetType>
-void InPredicate::set_lookup_prepare(FunctionContext* ctx,
-                                     FunctionContext::FunctionStateScope scope) {
-    if (scope != FunctionContext::FRAGMENT_LOCAL) {
-        return;
-    }
-
-    SetLookupState<SetType>* state = new SetLookupState<SetType>;
-    state->type = ctx->get_arg_type(0);
-    state->contains_null = false;
-    for (int i = 1; i < ctx->get_num_args(); ++i) {
-        DCHECK(ctx->is_arg_constant(i));
-        T* arg = reinterpret_cast<T*>(ctx->get_constant_arg(i));
-        if (arg->is_null) {
-            state->contains_null = true;
-        } else {
-            state->val_set.insert(get_val<T, SetType>(state->type, *arg));
-        }
-    }
-    ctx->set_function_state(scope, state);
-}
-
-template <typename SetType>
-void InPredicate::set_lookup_close(FunctionContext* ctx,
-                                   FunctionContext::FunctionStateScope scope) {
-    if (scope != FunctionContext::FRAGMENT_LOCAL) {
-        return;
-    }
-    SetLookupState<SetType>* state =
-            reinterpret_cast<SetLookupState<SetType>*>(ctx->get_function_state(scope));
-    delete state;
-}
-
-template <typename T, typename SetType, bool not_in, InPredicate::Strategy strategy>
-BooleanVal InPredicate::templated_in(FunctionContext* ctx, const T& val, int num_args,
-                                     const T* args) {
-    if (val.is_null) {
-        return BooleanVal::null();
-    }
-
-    BooleanVal found;
-    if (strategy == SET_LOOKUP) {
-        SetLookupState<SetType>* state = reinterpret_cast<SetLookupState<SetType>*>(
-                ctx->get_function_state(FunctionContext::FRAGMENT_LOCAL));
-        DCHECK(state != nullptr);
-        found = set_lookup(state, val);
-    } else {
-        DCHECK_EQ(strategy, ITERATE);
-        found = iterate(ctx->get_arg_type(0), val, num_args, args);
-    }
-    if (found.is_null) {
-        return BooleanVal::null();
-    }
-    return BooleanVal(found.val ^ not_in);
-}
-
-template <typename T, typename SetType>
-BooleanVal InPredicate::set_lookup(SetLookupState<SetType>* state, const T& v) {
-    DCHECK(state != nullptr);
-    SetType val = get_val<T, SetType>(state->type, v);
-    bool found = state->val_set.find(val) != state->val_set.end();
-    if (found) {
-        return BooleanVal(true);
-    }
-    if (state->contains_null) {
-        return BooleanVal::null();
-    }
-    return BooleanVal(false);
-}
-
-template <typename T>
-BooleanVal InPredicate::iterate(const FunctionContext::TypeDesc* type, const T& val, int num_args,
-                                const T* args) {
-    bool found_null = false;
-    for (int i = 0; i < num_args; ++i) {
-        if (args[i].is_null) {
-            found_null = true;
-        } else if (AnyValUtil::equals(*type, val, args[i])) {
-            return BooleanVal(true);
-        }
-    }
-    if (found_null) {
-        return BooleanVal::null();
-    }
-    return BooleanVal(false);
-}
-
-#define IN_FUNCTIONS(AnyValType, SetType, type_name)                                               \
-    BooleanVal InPredicate::in_set_lookup(FunctionContext* context, const AnyValType& val,         \
-                                          int num_args, const AnyValType* args) {                  \
-        return templated_in<AnyValType, SetType, false, SET_LOOKUP>(context, val, num_args, args); \
-    }                                                                                              \
-                                                                                                   \
-    BooleanVal InPredicate::not_in_set_lookup(FunctionContext* context, const AnyValType& val,     \
-                                              int num_args, const AnyValType* args) {              \
-        return templated_in<AnyValType, SetType, true, SET_LOOKUP>(context, val, num_args, args);  \
-    }                                                                                              \
-                                                                                                   \
-    BooleanVal InPredicate::in_iterate(FunctionContext* context, const AnyValType& val,            \
-                                       int num_args, const AnyValType* args) {                     \
-        return templated_in<AnyValType, SetType, false, ITERATE>(context, val, num_args, args);    \
-    }                                                                                              \
-                                                                                                   \
-    BooleanVal InPredicate::not_in_iterate(FunctionContext* context, const AnyValType& val,        \
-                                           int num_args, const AnyValType* args) {                 \
-        return templated_in<AnyValType, SetType, true, ITERATE>(context, val, num_args, args);     \
-    }                                                                                              \
-                                                                                                   \
-    void InPredicate::set_lookup_prepare_##type_name(FunctionContext* ctx,                         \
-                                                     FunctionContext::FunctionStateScope scope) {  \
-        set_lookup_prepare<AnyValType, SetType>(ctx, scope);                                       \
-    }                                                                                              \
-                                                                                                   \
-    void InPredicate::set_lookup_close_##type_name(FunctionContext* ctx,                           \
-                                                   FunctionContext::FunctionStateScope scope) {    \
-        set_lookup_close<SetType>(ctx, scope);                                                     \
-    }
-
-IN_FUNCTIONS(BooleanVal, bool, boolean_val)
-IN_FUNCTIONS(TinyIntVal, int8_t, tiny_int_val)
-IN_FUNCTIONS(SmallIntVal, int16_t, small_int_val)
-IN_FUNCTIONS(IntVal, int32_t, int_val)
-IN_FUNCTIONS(BigIntVal, int64_t, big_int_val)
-IN_FUNCTIONS(FloatVal, float, float_val)
-IN_FUNCTIONS(DoubleVal, double, double_val)
-IN_FUNCTIONS(StringVal, StringValue, string_val)
-IN_FUNCTIONS(DateTimeVal, DateTimeValue, datetime_val)
-IN_FUNCTIONS(DecimalV2Val, DecimalV2Value, decimalv2_val)
-IN_FUNCTIONS(LargeIntVal, __int128, large_int_val)
-
-// Needed for in-predicate-benchmark to build
-template BooleanVal InPredicate::iterate<IntVal>(const FunctionContext::TypeDesc*, const IntVal&,
-                                                 int, const IntVal*);
-} // namespace doris
diff --git a/be/src/exprs/new_in_predicate.h b/be/src/exprs/new_in_predicate.h
deleted file mode 100644
index 6238894..0000000
--- a/be/src/exprs/new_in_predicate.h
+++ /dev/null
@@ -1,348 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-#ifndef DORIS_BE_SRC_QUERY_EXPRS_NEW_IN_PREDICATE_H
-#define DORIS_BE_SRC_QUERY_EXPRS_NEW_IN_PREDICATE_H
-
-#include <string>
-
-#include "exprs/predicate.h"
-#include "udf/udf.h"
-
-/* added by lide */
-#define IN_FUNCTIONS_STMT(AnyValType, SetType, type_name)                                          \
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,                \
-                                               const doris_udf::AnyValType& val, int num_args,     \
-                                               const doris_udf::AnyValType* args);                 \
-                                                                                                   \
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,            \
-                                                   const doris_udf::AnyValType& val, int num_args, \
-                                                   const doris_udf::AnyValType* args);             \
-                                                                                                   \
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,                   \
-                                            const doris_udf::AnyValType& val, int num_args,        \
-                                            const doris_udf::AnyValType* args);                    \
-                                                                                                   \
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,               \
-                                                const doris_udf::AnyValType& val, int num_args,    \
-                                                const doris_udf::AnyValType* args);                \
-                                                                                                   \
-    static void set_lookup_prepare_##type_name(                                                    \
-            doris_udf::FunctionContext* ctx,                                                       \
-            doris_udf::FunctionContext::FunctionStateScope scope);                                 \
-                                                                                                   \
-    static void set_lookup_close_##type_name(                                                      \
-            doris_udf::FunctionContext* ctx,                                                       \
-            doris_udf::FunctionContext::FunctionStateScope scope);
-
-namespace doris {
-
-/// Predicate for evaluating expressions of the form "val [NOT] IN (x1, x2, x3...)".
-//
-/// There are two strategies for evaluating the IN predicate:
-//
-/// 1) SET_LOOKUP: This strategy is for when all the values in the IN list are constant. In
-///    the prepare function, we create a set of the constant values from the IN list, and
-///    use this set to lookup a given 'val'.
-//
-/// 2) ITERATE: This is the fallback strategy for when their are non-constant IN list
-///    values, or very few values in the IN list. We simply iterate through every
-///    expression and compare it to val. This strategy has no prepare function.
-//
-/// The FE chooses which strategy we should use by choosing the appropriate function (e.g.,
-/// in_iterate() or in_set_lookup()). If it chooses SET_LOOKUP, it also sets the appropriate
-/// set_lookup_prepare and set_lookup_close functions.
-//
-/// TODO: the set lookup logic is not yet implemented for DateTimeVals or DecimalVals
-class InPredicate {
-public:
-    static void init();
-
-    /// Functions for every type
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::BooleanVal& val, int num_args,
-                                            const doris_udf::BooleanVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::BooleanVal& val, int num_args,
-                                                const doris_udf::BooleanVal* args);
-
-    static void set_lookup_prepare_boolean_val(
-            doris_udf::FunctionContext* ctx, doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_boolean_val(doris_udf::FunctionContext* ctx,
-                                             doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::BooleanVal& val, int num_args,
-                                               const doris_udf::BooleanVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::BooleanVal& val, int num_args,
-                                                   const doris_udf::BooleanVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::TinyIntVal& val, int num_args,
-                                            const doris_udf::TinyIntVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::TinyIntVal& val, int num_args,
-                                                const doris_udf::TinyIntVal* args);
-
-    static void set_lookup_prepare_tiny_int_val(
-            doris_udf::FunctionContext* ctx, doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_tiny_int_val(doris_udf::FunctionContext* ctx,
-                                              doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::TinyIntVal& val, int num_args,
-                                               const doris_udf::TinyIntVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::TinyIntVal& val, int num_args,
-                                                   const doris_udf::TinyIntVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::SmallIntVal& val, int num_args,
-                                            const doris_udf::SmallIntVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::SmallIntVal& val, int num_args,
-                                                const doris_udf::SmallIntVal* args);
-
-    static void set_lookup_prepare_small_int_val(
-            doris_udf::FunctionContext* ctx, doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_small_int_val(
-            doris_udf::FunctionContext* ctx, doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::SmallIntVal& val, int num_args,
-                                               const doris_udf::SmallIntVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::SmallIntVal& val, int num_args,
-                                                   const doris_udf::SmallIntVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::IntVal& val, int num_args,
-                                            const doris_udf::IntVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::IntVal& val, int num_args,
-                                                const doris_udf::IntVal* args);
-
-    static void set_lookup_prepare_int_val(doris_udf::FunctionContext* ctx,
-                                           doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_int_val(doris_udf::FunctionContext* ctx,
-                                         doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::IntVal& val, int num_args,
-                                               const doris_udf::IntVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::IntVal& val, int num_args,
-                                                   const doris_udf::IntVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::BigIntVal& val, int num_args,
-                                            const doris_udf::BigIntVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::BigIntVal& val, int num_args,
-                                                const doris_udf::BigIntVal* args);
-
-    static void set_lookup_prepare_big_int_val(
-            doris_udf::FunctionContext* ctx, doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_big_int_val(doris_udf::FunctionContext* ctx,
-                                             doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::BigIntVal& val, int num_args,
-                                               const doris_udf::BigIntVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::BigIntVal& val, int num_args,
-                                                   const doris_udf::BigIntVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::FloatVal& val, int num_args,
-                                            const doris_udf::FloatVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::FloatVal& val, int num_args,
-                                                const doris_udf::FloatVal* args);
-
-    static void set_lookup_prepare_float_val(doris_udf::FunctionContext* ctx,
-                                             doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_float_val(doris_udf::FunctionContext* ctx,
-                                           doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::FloatVal& val, int num_args,
-                                               const doris_udf::FloatVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::FloatVal& val, int num_args,
-                                                   const doris_udf::FloatVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::DoubleVal& val, int num_args,
-                                            const doris_udf::DoubleVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::DoubleVal& val, int num_args,
-                                                const doris_udf::DoubleVal* args);
-
-    static void set_lookup_prepare_double_val(doris_udf::FunctionContext* ctx,
-                                              doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_double_val(doris_udf::FunctionContext* ctx,
-                                            doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::DoubleVal& val, int num_args,
-                                               const doris_udf::DoubleVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::DoubleVal& val, int num_args,
-                                                   const doris_udf::DoubleVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::StringVal& val, int num_args,
-                                            const doris_udf::StringVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::StringVal& val, int num_args,
-                                                const doris_udf::StringVal* args);
-
-    static void set_lookup_prepare_string_val(doris_udf::FunctionContext* ctx,
-                                              doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_string_val(doris_udf::FunctionContext* ctx,
-                                            doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::StringVal& val, int num_args,
-                                               const doris_udf::StringVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::StringVal& val, int num_args,
-                                                   const doris_udf::StringVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::DateTimeVal& val, int num_args,
-                                            const doris_udf::DateTimeVal* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::DateTimeVal& val, int num_args,
-                                                const doris_udf::DateTimeVal* args);
-
-    static void set_lookup_prepare_datetime_val(
-            doris_udf::FunctionContext* ctx, doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_datetime_val(doris_udf::FunctionContext* ctx,
-                                              doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::DateTimeVal& val, int num_args,
-                                               const doris_udf::DateTimeVal* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::DateTimeVal& val, int num_args,
-                                                   const doris_udf::DateTimeVal* args);
-
-    static doris_udf::BooleanVal in_iterate(doris_udf::FunctionContext* context,
-                                            const doris_udf::DecimalV2Val& val, int num_args,
-                                            const doris_udf::DecimalV2Val* args);
-
-    static doris_udf::BooleanVal not_in_iterate(doris_udf::FunctionContext* context,
-                                                const doris_udf::DecimalV2Val& val, int num_args,
-                                                const doris_udf::DecimalV2Val* args);
-
-    static void set_lookup_prepare_decimalv2_val(
-            doris_udf::FunctionContext* ctx, doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static void set_lookup_close_decimalv2_val(
-            doris_udf::FunctionContext* ctx, doris_udf::FunctionContext::FunctionStateScope scope);
-
-    static doris_udf::BooleanVal in_set_lookup(doris_udf::FunctionContext* context,
-                                               const doris_udf::DecimalV2Val& val, int num_args,
-                                               const doris_udf::DecimalV2Val* args);
-
-    static doris_udf::BooleanVal not_in_set_lookup(doris_udf::FunctionContext* context,
-                                                   const doris_udf::DecimalV2Val& val, int num_args,
-                                                   const doris_udf::DecimalV2Val* args);
-
-    /* added by lide */
-    IN_FUNCTIONS_STMT(LargeIntVal, __int128, large_int_val)
-
-private:
-    friend class InPredicateBenchmark;
-
-    enum Strategy {
-        /// Indicates we should use SetLookUp().
-        SET_LOOKUP,
-        /// Indicates we should use Iterate().
-        ITERATE
-    };
-
-    template <typename SetType>
-    struct SetLookupState {
-        /// If true, there is at least one nullptr constant in the IN list.
-        bool contains_null;
-
-        /// The set of all non-nullptr constant values in the IN list.
-        /// Note: std::unordered_set and std::binary_search performed worse based on the
-        /// in-predicate-benchmark
-        std::set<SetType> val_set;
-
-        /// The type of the arguments
-        const FunctionContext::TypeDesc* type;
-    };
-
-    /// The templated function that provides the implementation for all the In() and NotIn()
-    /// functions.
-    template <typename T, typename SetType, bool not_in, Strategy strategy>
-    static inline doris_udf::BooleanVal templated_in(doris_udf::FunctionContext* context,
-                                                     const T& val, int num_args, const T* args);
-
-    /// Initializes an SetLookupState in ctx.
-    template <typename T, typename SetType>
-    static void set_lookup_prepare(FunctionContext* ctx, FunctionContext::FunctionStateScope scope);
-
-    template <typename SetType>
-    static void set_lookup_close(FunctionContext* ctx, FunctionContext::FunctionStateScope scope);
-
-    /// Looks up v in state->val_set.
-    template <typename T, typename SetType>
-    static BooleanVal set_lookup(SetLookupState<SetType>* state, const T& v);
-
-    /// Iterates through each vararg looking for val. 'type' is the type of 'val' and 'args'.
-    template <typename T>
-    static BooleanVal iterate(const FunctionContext::TypeDesc* type, const T& val, int num_args,
-                              const T* args);
-};
-
-} // namespace doris
-
-#endif

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


[incubator-doris] 02/04: [fix](be-ut) fix bitmap_ut result wrong && fix schema_change compile error (#8261)

Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2efcbfabfce000bfc8f63747820b2bc99c3ddab4
Author: Pxl <95...@qq.com>
AuthorDate: Tue Mar 1 11:11:02 2022 +0800

    [fix](be-ut) fix bitmap_ut result wrong && fix schema_change compile error (#8261)
---
 be/test/olap/schema_change_test.cpp           | 96 ++++++++++++++-------------
 be/test/vec/function/function_bitmap_test.cpp | 39 ++++++-----
 2 files changed, 70 insertions(+), 65 deletions(-)

diff --git a/be/test/olap/schema_change_test.cpp b/be/test/olap/schema_change_test.cpp
index 9efcedf..1976f9a 100644
--- a/be/test/olap/schema_change_test.cpp
+++ b/be/test/olap/schema_change_test.cpp
@@ -180,8 +180,8 @@ public:
     }
 
     void set_tablet_schema(const std::string& name, const std::string& type,
-                         const std::string& aggregation, uint32_t length, bool is_allow_null,
-                         bool is_key, TabletSchema* tablet_schema) {
+                           const std::string& aggregation, uint32_t length, bool is_allow_null,
+                           bool is_key, TabletSchema* tablet_schema) {
         TabletSchemaPB tablet_schema_pb;
         ColumnPB* column = tablet_schema_pb.add_column();
         column->set_unique_id(0);
@@ -204,7 +204,7 @@ public:
                                  int varchar_len = 255) {
         TabletSchema src_tablet_schema;
         set_tablet_schema("ConvertColumn", type_name, "REPLACE", type_size, false, false,
-                        &src_tablet_schema);
+                          &src_tablet_schema);
         create_column_writer(src_tablet_schema);
 
         RowCursor write_row;
@@ -223,7 +223,7 @@ public:
 
         TabletSchema dst_tablet_schema;
         set_tablet_schema("VarcharColumn", "VARCHAR", "REPLACE", varchar_len, false, false,
-                        &dst_tablet_schema);
+                          &dst_tablet_schema);
         create_column_reader(src_tablet_schema);
         RowCursor read_row;
         read_row.init(dst_tablet_schema);
@@ -267,7 +267,7 @@ public:
 
         TabletSchema converted_tablet_schema;
         set_tablet_schema("ConvertColumn", type_name, "REPLACE", type_size, false, false,
-                        &converted_tablet_schema);
+                          &converted_tablet_schema);
         create_column_reader(tablet_schema);
         RowCursor read_row;
         read_row.init(converted_tablet_schema);
@@ -355,7 +355,7 @@ TEST_F(TestColumn, ConvertFloatToDouble) {
     sprintf(buf, "%f", val2);
     char* tg;
     double v2 = strtod(buf, &tg);
-    ASSERT_TRUE(v2 == 1.234);
+    ASSERT_EQ(v2, 1.234);
 
     //test not support type
     TypeInfo* tp = get_scalar_type_info(OLAP_FIELD_TYPE_HLL);
@@ -434,7 +434,7 @@ TEST_F(TestColumn, ConvertDateToDatetime) {
 
     TabletSchema convert_tablet_schema;
     set_tablet_schema("DateTimeColumn", "DATETIME", "REPLACE", 8, false, false,
-                    &convert_tablet_schema);
+                      &convert_tablet_schema);
     create_column_reader(tablet_schema);
     RowCursor read_row;
     read_row.init(convert_tablet_schema);
@@ -691,47 +691,44 @@ TEST_F(TestColumn, ConvertBigIntToVarchar22) {
 TEST_F(TestColumn, ConvertLargeIntToVarchar39) {
     std::string str_val("170141183460469231731687303715884105727");
     StringParser::ParseResult result;
-    int128_t int128_val = StringParser::string_to_int<int128_t>(str_val.c_str(),
-                                                                str_val.length(), &result);
+    int128_t int128_val =
+            StringParser::string_to_int<int128_t>(str_val.c_str(), str_val.length(), &result);
     DCHECK(result == StringParser::PARSE_SUCCESS);
-    test_convert_to_varchar<int128_t>("LARGEINT", 16, int128_val,
-                                      "", OLAP_ERR_INPUT_PARAMETER_ERROR, 39);
+    test_convert_to_varchar<int128_t>("LARGEINT", 16, int128_val, "",
+                                      OLAP_ERR_INPUT_PARAMETER_ERROR, 39);
 }
 
 TEST_F(TestColumn, ConvertLargeIntToVarchar41) {
     std::string str_val("170141183460469231731687303715884105727");
     StringParser::ParseResult result;
-    int128_t int128_val = StringParser::string_to_int<int128_t>(str_val.c_str(),
-                                                                str_val.length(), &result);
+    int128_t int128_val =
+            StringParser::string_to_int<int128_t>(str_val.c_str(), str_val.length(), &result);
     DCHECK(result == StringParser::PARSE_SUCCESS);
-    test_convert_to_varchar<int128_t>("LARGEINT", 16, int128_val,
-                                      str_val,
-                                      OLAP_SUCCESS, 41);
+    test_convert_to_varchar<int128_t>("LARGEINT", 16, int128_val, str_val, OLAP_SUCCESS, 41);
 }
 
 TEST_F(TestColumn, ConvertLargeIntToVarchar40) {
     std::string str_val = "-170141183460469231731687303715884105727";
     StringParser::ParseResult result;
-    int128_t int128_val = StringParser::string_to_int<int128_t>(str_val.c_str(),
-                                                       str_val.length(), &result);
+    int128_t int128_val =
+            StringParser::string_to_int<int128_t>(str_val.c_str(), str_val.length(), &result);
     DCHECK(result == StringParser::PARSE_SUCCESS);
-    test_convert_to_varchar<int128_t>("LARGEINT", 16, int128_val,
-                                      "", OLAP_ERR_INPUT_PARAMETER_ERROR, 40);
+    test_convert_to_varchar<int128_t>("LARGEINT", 16, int128_val, "",
+                                      OLAP_ERR_INPUT_PARAMETER_ERROR, 40);
 }
 
 TEST_F(TestColumn, ConvertLargeIntToVarchar46) {
     std::string str_val = "-170141183460469231731687303715884105727";
     StringParser::ParseResult result;
-    int128_t int128_val = StringParser::string_to_int<int128_t>(str_val.c_str(),
-                                                       str_val.length(), &result);
+    int128_t int128_val =
+            StringParser::string_to_int<int128_t>(str_val.c_str(), str_val.length(), &result);
     DCHECK(result == StringParser::PARSE_SUCCESS);
-    test_convert_to_varchar<int128_t>("LARGEINT", 16, int128_val,
-                                      str_val,
-                                      OLAP_SUCCESS, 42);
+    test_convert_to_varchar<int128_t>("LARGEINT", 16, int128_val, str_val, OLAP_SUCCESS, 42);
 }
 
 TEST_F(TestColumn, ConvertFloatToVarchar11) {
-    test_convert_to_varchar<float>("FLOAT", 4, 3.40282e+38, "3.40282e+38", OLAP_ERR_INPUT_PARAMETER_ERROR, 11);
+    test_convert_to_varchar<float>("FLOAT", 4, 3.40282e+38, "3.40282e+38",
+                                   OLAP_ERR_INPUT_PARAMETER_ERROR, 11);
 }
 
 TEST_F(TestColumn, ConvertFloatToVarchar13) {
@@ -739,11 +736,13 @@ TEST_F(TestColumn, ConvertFloatToVarchar13) {
 }
 
 TEST_F(TestColumn, ConvertFloatToVarchar13_2) {
-    test_convert_to_varchar<float>("FLOAT", 4, 3402820000000000000l, "3.40282e+18", OLAP_SUCCESS, 13);
+    test_convert_to_varchar<float>("FLOAT", 4, 3402820000000000000.0, "3.40282e+18", OLAP_SUCCESS,
+                                   13);
 }
 
 TEST_F(TestColumn, ConvertFloatToVarchar12) {
-    test_convert_to_varchar<float>("FLOAT", 4, -3.40282e+38, "-3.40282e+38", OLAP_ERR_INPUT_PARAMETER_ERROR, 12);
+    test_convert_to_varchar<float>("FLOAT", 4, -3.40282e+38, "-3.40282e+38",
+                                   OLAP_ERR_INPUT_PARAMETER_ERROR, 12);
 }
 
 TEST_F(TestColumn, ConvertFloatToVarchar14) {
@@ -751,7 +750,8 @@ TEST_F(TestColumn, ConvertFloatToVarchar14) {
 }
 
 TEST_F(TestColumn, ConvertFloatToVarchar14_2) {
-    test_convert_to_varchar<float>("FLOAT", 4, -3402820000000000000l, "-3.40282e+18", OLAP_SUCCESS, 14);
+    test_convert_to_varchar<float>("FLOAT", 4, -3402820000000000000.0, "-3.40282e+18", OLAP_SUCCESS,
+                                   14);
 }
 
 TEST_F(TestColumn, ConvertFloatToVarchar13_3) {
@@ -765,7 +765,6 @@ TEST_F(TestColumn, ConvertFloatToVarchar15) {
 }
 
 TEST_F(TestColumn, ConvertFloatToVarchar14_3) {
-
     test_convert_to_varchar<float>("FLOAT", 4, -1.17549435082228750796873653722224568e-38F,
                                    "-1.1754944e-38", OLAP_ERR_INPUT_PARAMETER_ERROR, 14);
 }
@@ -776,7 +775,8 @@ TEST_F(TestColumn, ConvertFloatToVarchar16) {
 }
 
 TEST_F(TestColumn, ConvertDoubleToVarchar7) {
-    test_convert_to_varchar<double>("DOUBLE", 8, 123.456, "123.456", OLAP_ERR_INPUT_PARAMETER_ERROR, 7);
+    test_convert_to_varchar<double>("DOUBLE", 8, 123.456, "123.456", OLAP_ERR_INPUT_PARAMETER_ERROR,
+                                    7);
 }
 
 TEST_F(TestColumn, ConvertDoubleToVarchar9) {
@@ -794,23 +794,23 @@ TEST_F(TestColumn, ConvertDoubleToVarchar25) {
 }
 
 TEST_F(TestColumn, ConvertDoubleToVarchar22) {
-    test_convert_to_varchar<double>("DOUBLE", 8, 1797693134862315708l,
-                                    "1.7976931348623158e+18", OLAP_ERR_INPUT_PARAMETER_ERROR, 22);
+    test_convert_to_varchar<double>("DOUBLE", 8, 1797693134862315708.0, "1.7976931348623158e+18",
+                                    OLAP_ERR_INPUT_PARAMETER_ERROR, 22);
 }
 
 TEST_F(TestColumn, ConvertDoubleToVarchar24) {
-    test_convert_to_varchar<double>("DOUBLE", 8, 1797693134862315708l,
-                                    "1.7976931348623158e+18", OLAP_SUCCESS, 24);
+    test_convert_to_varchar<double>("DOUBLE", 8, 1797693134862315708.0, "1.7976931348623158e+18",
+                                    OLAP_SUCCESS, 24);
 }
 
 TEST_F(TestColumn, ConvertDoubleToVarchar23_2) {
-    test_convert_to_varchar<double>("DOUBLE", 8, -1797693134862315708l,
-                                    "-1.7976931348623158e+18", OLAP_ERR_INPUT_PARAMETER_ERROR, 23);
+    test_convert_to_varchar<double>("DOUBLE", 8, -1797693134862315708.0, "-1.7976931348623158e+18",
+                                    OLAP_ERR_INPUT_PARAMETER_ERROR, 23);
 }
 
 TEST_F(TestColumn, ConvertDoubleToVarchar25_2) {
-    test_convert_to_varchar<double>("DOUBLE", 8, -1797693134862315708l,
-                                    "-1.7976931348623158e+18", OLAP_SUCCESS, 25);
+    test_convert_to_varchar<double>("DOUBLE", 8, -1797693134862315708.0, "-1.7976931348623158e+18",
+                                    OLAP_SUCCESS, 25);
 }
 
 TEST_F(TestColumn, ConvertDoubleToVarchar23_3) {
@@ -835,8 +835,8 @@ TEST_F(TestColumn, ConvertDoubleToVarchar26) {
 
 TEST_F(TestColumn, ConvertDecimalToVarchar13) {
     decimal12_t val = {456, 789000000};
-    test_convert_to_varchar<decimal12_t>("Decimal", 12, val,
-                                         "456.789000000", OLAP_ERR_INPUT_PARAMETER_ERROR, 13);
+    test_convert_to_varchar<decimal12_t>("Decimal", 12, val, "456.789000000",
+                                         OLAP_ERR_INPUT_PARAMETER_ERROR, 13);
 }
 
 TEST_F(TestColumn, ConvertDecimalToVarchar15) {
@@ -846,24 +846,26 @@ TEST_F(TestColumn, ConvertDecimalToVarchar15) {
 
 TEST_F(TestColumn, ConvertDecimalToVarchar28) {
     decimal12_t val = {999999999999999999, 999999999};
-    test_convert_to_varchar<decimal12_t>("Decimal", 12, val, "", OLAP_ERR_INPUT_PARAMETER_ERROR, 28);
+    test_convert_to_varchar<decimal12_t>("Decimal", 12, val, "", OLAP_ERR_INPUT_PARAMETER_ERROR,
+                                         28);
 }
 
 TEST_F(TestColumn, ConvertDecimalToVarchar30) {
     decimal12_t val = {999999999999999999, 999999999};
-    test_convert_to_varchar<decimal12_t>("Decimal", 12, val,
-                                         "999999999999999999.999999999", OLAP_SUCCESS, 30);
+    test_convert_to_varchar<decimal12_t>("Decimal", 12, val, "999999999999999999.999999999",
+                                         OLAP_SUCCESS, 30);
 }
 
 TEST_F(TestColumn, ConvertDecimalToVarchar29) {
     decimal12_t val = {-999999999999999999, 999999999};
-    test_convert_to_varchar<decimal12_t>("Decimal", 12, val, "", OLAP_ERR_INPUT_PARAMETER_ERROR, 29);
+    test_convert_to_varchar<decimal12_t>("Decimal", 12, val, "", OLAP_ERR_INPUT_PARAMETER_ERROR,
+                                         29);
 }
 
 TEST_F(TestColumn, ConvertDecimalToVarchar31) {
     decimal12_t val = {-999999999999999999, 999999999};
-    test_convert_to_varchar<decimal12_t>("Decimal", 12, val,
-                                         "-999999999999999999.999999999", OLAP_SUCCESS, 31);
+    test_convert_to_varchar<decimal12_t>("Decimal", 12, val, "-999999999999999999.999999999",
+                                         OLAP_SUCCESS, 31);
 }
 
 void CreateTabletSchema(TabletSchema& tablet_schema) {
diff --git a/be/test/vec/function/function_bitmap_test.cpp b/be/test/vec/function/function_bitmap_test.cpp
index 95cb072..2341c91 100644
--- a/be/test/vec/function/function_bitmap_test.cpp
+++ b/be/test/vec/function/function_bitmap_test.cpp
@@ -31,7 +31,7 @@ TEST(function_bitmap_test, function_bitmap_min_test) {
     auto empty_bitmap = new BitmapValue();
     DataSet data_set = {{{bitmap1}, (int64_t)1},
                         {{bitmap2}, (int64_t)1},
-                        {{empty_bitmap}, (int64_t)0},
+                        {{empty_bitmap}, Null()},
                         {{Null()}, Null()}};
 
     check_function<DataTypeInt64, true>(func_name, input_types, data_set);
@@ -48,7 +48,7 @@ TEST(function_bitmap_test, function_bitmap_max_test) {
     auto empty_bitmap = new BitmapValue();
     DataSet data_set = {{{bitmap1}, (int64_t)1},
                         {{bitmap2}, (int64_t)9999999},
-                        {{empty_bitmap}, (int64_t)0},
+                        {{empty_bitmap}, Null()},
                         {{Null()}, Null()}};
 
     check_function<DataTypeInt64, true>(func_name, input_types, data_set);
@@ -97,10 +97,10 @@ TEST(function_bitmap_test, function_bitmap_and_count) {
         BitmapValue bitmap3({33, 5, std::numeric_limits<uint64_t>::max()});
         auto empty_bitmap = new BitmapValue(); //test empty
 
-        DataSet data_set = {{{&bitmap1, &bitmap2, empty_bitmap}, (int64_t)0},   
-                            {{&bitmap1, &bitmap2, &bitmap3}, (int64_t)1},       //33
-                            {{&bitmap1, &bitmap2, Null()}, Null()},             
-                            {{&bitmap1, &bitmap3, &bitmap3}, (int64_t)1}};      //33
+        DataSet data_set = {{{&bitmap1, &bitmap2, empty_bitmap}, (int64_t)0},
+                            {{&bitmap1, &bitmap2, &bitmap3}, (int64_t)1}, //33
+                            {{&bitmap1, &bitmap2, Null()}, Null()},
+                            {{&bitmap1, &bitmap3, &bitmap3}, (int64_t)1}}; //33
 
         check_function<DataTypeInt64, true>(func_name, input_types, data_set);
         delete empty_bitmap;
@@ -128,13 +128,15 @@ TEST(function_bitmap_test, function_bitmap_or_count) {
         InputTypeSet input_types = {TypeIndex::BitMap, TypeIndex::BitMap, TypeIndex::BitMap};
         BitmapValue bitmap1({1024, 1, 2019});
         BitmapValue bitmap2({0, 33, std::numeric_limits<uint64_t>::min()});
-        BitmapValue bitmap3({33, 5, std::numeric_limits<uint64_t>::max()});    //18446744073709551615
-        auto empty_bitmap = new BitmapValue(); //test empty
+        BitmapValue bitmap3({33, 5, std::numeric_limits<uint64_t>::max()}); //18446744073709551615
+        auto empty_bitmap = new BitmapValue();                              //test empty
 
-        DataSet data_set = {{{&bitmap1, &bitmap2, empty_bitmap}, (int64_t)5},  //0,1,33,1024,2019 
-                            {{&bitmap1, &bitmap2, &bitmap3}, (int64_t)7},      //0,1,5,33,1024,2019,18446744073709551615
+        DataSet data_set = {{{&bitmap1, &bitmap2, empty_bitmap}, (int64_t)5}, //0,1,33,1024,2019
+                            {{&bitmap1, &bitmap2, &bitmap3},
+                             (int64_t)7}, //0,1,5,33,1024,2019,18446744073709551615
                             {{&bitmap1, empty_bitmap, Null()}, Null()},
-                            {{&bitmap1, &bitmap3, &bitmap3}, (int64_t)6}};     //1,5,33,1024,2019,18446744073709551615
+                            {{&bitmap1, &bitmap3, &bitmap3},
+                             (int64_t)6}}; //1,5,33,1024,2019,18446744073709551615
 
         check_function<DataTypeInt64, true>(func_name, input_types, data_set);
         delete empty_bitmap;
@@ -167,10 +169,11 @@ TEST(function_bitmap_test, function_bitmap_xor_count) {
         BitmapValue bitmap3({33, 5, std::numeric_limits<uint64_t>::max()});
         auto empty_bitmap = new BitmapValue(); //test empty
 
-        DataSet data_set = {{{&bitmap1, &bitmap2, empty_bitmap}, (int64_t)5},  //0,1,33,1024,2019
-                            {{&bitmap1, &bitmap2, &bitmap3}, (int64_t)6},      //0,1,5,1024,2019,18446744073709551615
-                            {{&bitmap1, empty_bitmap, Null()}, Null()},
-                            {{&bitmap1, &bitmap3, &bitmap3}, (int64_t)3}};     //1,1024,2019
+        DataSet data_set = {
+                {{&bitmap1, &bitmap2, empty_bitmap}, (int64_t)5}, //0,1,33,1024,2019
+                {{&bitmap1, &bitmap2, &bitmap3}, (int64_t)6}, //0,1,5,1024,2019,18446744073709551615
+                {{&bitmap1, empty_bitmap, Null()}, Null()},
+                {{&bitmap1, &bitmap3, &bitmap3}, (int64_t)3}}; //1,1024,2019
 
         check_function<DataTypeInt64, true>(func_name, input_types, data_set);
         delete empty_bitmap;
@@ -185,10 +188,10 @@ TEST(function_bitmap_test, function_bitmap_and_not_count) {
     BitmapValue bitmap3({33, 5, std::numeric_limits<uint64_t>::max()});
     auto empty_bitmap = new BitmapValue();
 
-    DataSet data_set = {{{&bitmap1, empty_bitmap}, (int64_t)3},  //1,2,3
+    DataSet data_set = {{{&bitmap1, empty_bitmap}, (int64_t)3}, //1,2,3
                         {{&bitmap2, Null()}, Null()},
-                        {{&bitmap2, &bitmap3}, (int64_t)3},      //0,3,4
-                        {{&bitmap1, &bitmap2}, (int64_t)2}};     //1,2
+                        {{&bitmap2, &bitmap3}, (int64_t)3},  //0,3,4
+                        {{&bitmap1, &bitmap2}, (int64_t)2}}; //1,2
 
     check_function<DataTypeInt64, true>(func_name, input_types, data_set);
     delete empty_bitmap;

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