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

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

commit 9f16ac2363f2777d55e7538eda2daee46df643b0
Author: Pxl <[email protected]>
AuthorDate: Tue Jan 11 10:48:02 2022 +0800

    [Vectorized][Bug] fix 'negative' function ut run fail && fix 
testIsBucketShuffleJoin run fail && fix some compile fail (#7688)
---
 be/src/util/brpc_stub_cache.h                      |  2 +-
 be/test/vec/function/function_hash_test.cpp        | 36 +++++++++++++---------
 be/test/vec/function/function_math_test.cpp        | 33 ++++++++------------
 .../org/apache/doris/planner/HashJoinNode.java     |  2 +-
 .../java/org/apache/doris/qe/CoordinatorTest.java  |  9 ++++--
 5 files changed, 44 insertions(+), 38 deletions(-)

diff --git a/be/src/util/brpc_stub_cache.h b/be/src/util/brpc_stub_cache.h
index e944aac..21800f3 100644
--- a/be/src/util/brpc_stub_cache.h
+++ b/be/src/util/brpc_stub_cache.h
@@ -47,7 +47,7 @@ namespace doris {
 class BrpcStubCache {
 public:
     BrpcStubCache();
-    ~BrpcStubCache();
+    virtual ~BrpcStubCache();
 
     inline std::shared_ptr<PBackendService_Stub> get_stub(const 
butil::EndPoint& endpoint) {
         auto stub_ptr = _stub_map.find(endpoint);
diff --git a/be/test/vec/function/function_hash_test.cpp 
b/be/test/vec/function/function_hash_test.cpp
index 75a2ac5..d5d41b2 100644
--- a/be/test/vec/function/function_hash_test.cpp
+++ b/be/test/vec/function/function_hash_test.cpp
@@ -33,20 +33,21 @@ TEST(HashFunctionTest, murmur_hash_3_test) {
     {
         std::vector<std::any> input_types = {vectorized::TypeIndex::String};
 
-        DataSet data_set = {{{Null()}, Null()},
-                            {{std::string("hello")}, (int32_t) 1321743225}};
+        DataSet data_set = {{{Null()}, Null()}, {{std::string("hello")}, 
(int32_t)1321743225}};
 
-        vectorized::check_function<vectorized::DataTypeInt32, true>(func_name, 
input_types, data_set);
+        vectorized::check_function<vectorized::DataTypeInt32, true>(func_name, 
input_types,
+                                                                    data_set);
     };
 
     {
         std::vector<std::any> input_types = {vectorized::TypeIndex::String,
                                              vectorized::TypeIndex::String};
 
-        DataSet data_set = {{{std::string("hello"), std::string("world")}, 
(int32_t) 984713481},
+        DataSet data_set = {{{std::string("hello"), std::string("world")}, 
(int32_t)984713481},
                             {{std::string("hello"), Null()}, Null()}};
 
-        vectorized::check_function<vectorized::DataTypeInt32, true>(func_name, 
input_types, data_set);
+        vectorized::check_function<vectorized::DataTypeInt32, true>(func_name, 
input_types,
+                                                                    data_set);
     };
 
     {
@@ -54,10 +55,12 @@ TEST(HashFunctionTest, murmur_hash_3_test) {
                                              vectorized::TypeIndex::String,
                                              vectorized::TypeIndex::String};
 
-        DataSet data_set = {{{std::string("hello"), std::string("world"), 
std::string("!")}, (int32_t) -666935433},
+        DataSet data_set = {{{std::string("hello"), std::string("world"), 
std::string("!")},
+                             (int32_t)-666935433},
                             {{std::string("hello"), std::string("world"), 
Null()}, Null()}};
 
-        vectorized::check_function<vectorized::DataTypeInt32, true>(func_name, 
input_types, data_set);
+        vectorized::check_function<vectorized::DataTypeInt32, true>(func_name, 
input_types,
+                                                                    data_set);
     };
 }
 
@@ -68,19 +71,22 @@ TEST(HashFunctionTest, murmur_hash_2_test) {
         std::vector<std::any> input_types = {vectorized::TypeIndex::String};
 
         DataSet data_set = {{{Null()}, Null()},
-                            {{std::string("hello")}, (uint64_t) 
2191231550387646743}};
+                            {{std::string("hello")}, 
(uint64_t)2191231550387646743ull}};
 
-        vectorized::check_function<vectorized::DataTypeUInt64, 
true>(func_name, input_types, data_set);
+        vectorized::check_function<vectorized::DataTypeUInt64, 
true>(func_name, input_types,
+                                                                     data_set);
     };
 
     {
         std::vector<std::any> input_types = {vectorized::TypeIndex::String,
                                              vectorized::TypeIndex::String};
 
-        DataSet data_set = {{{std::string("hello"), std::string("world")}, 
(uint64_t) 11978658642541747642l},
-                            {{std::string("hello"), Null()}, Null()}};
+        DataSet data_set = {
+                {{std::string("hello"), std::string("world")}, 
(uint64_t)11978658642541747642ull},
+                {{std::string("hello"), Null()}, Null()}};
 
-        vectorized::check_function<vectorized::DataTypeUInt64, 
true>(func_name, input_types, data_set);
+        vectorized::check_function<vectorized::DataTypeUInt64, 
true>(func_name, input_types,
+                                                                     data_set);
     };
 
     {
@@ -88,10 +94,12 @@ TEST(HashFunctionTest, murmur_hash_2_test) {
                                              vectorized::TypeIndex::String,
                                              vectorized::TypeIndex::String};
 
-        DataSet data_set = {{{std::string("hello"), std::string("world"), 
std::string("!")}, (uint64_t) 1367324781703025231},
+        DataSet data_set = {{{std::string("hello"), std::string("world"), 
std::string("!")},
+                             (uint64_t)1367324781703025231ull},
                             {{std::string("hello"), std::string("world"), 
Null()}, Null()}};
 
-        vectorized::check_function<vectorized::DataTypeUInt64, 
true>(func_name, input_types, data_set);
+        vectorized::check_function<vectorized::DataTypeUInt64, 
true>(func_name, input_types,
+                                                                     data_set);
     };
 }
 
diff --git a/be/test/vec/function/function_math_test.cpp 
b/be/test/vec/function/function_math_test.cpp
index 0413abd..17748a0 100644
--- a/be/test/vec/function/function_math_test.cpp
+++ b/be/test/vec/function/function_math_test.cpp
@@ -306,9 +306,9 @@ TEST(MathFunctionTest, negative_test) {
         std::vector<std::any> input_types = {vectorized::TypeIndex::Int32};
 
         DataSet data_set = {{{(int32_t)3}, (int32_t)-3},
-                            {{(int32_t)-3}, (int32_t)-3},
+                            {{(int32_t)-3}, (int32_t)3},
                             {{(int32_t)0}, (int32_t)0},
-                            {{(int32_t)-60}, (int32_t)-60}};
+                            {{(int32_t)-60}, (int32_t)60}};
 
         vectorized::check_function<vectorized::DataTypeInt32, true>(func_name, 
input_types,
                                                                     data_set);
@@ -344,12 +344,8 @@ TEST(MathFunctionTest, round_test) {
     {
         std::vector<std::any> input_types = {vectorized::TypeIndex::Float64};
 
-        DataSet data_set = {{{30.1}, (int64_t)30},
-                            {{90.6}, (int64_t)91},
-                            {{Null()}, Null()},
-                            {{0.0}, (int64_t)0},
-                            {{-1.1}, (int64_t)-1},
-                            {{-60.7}, (int64_t)-61}};
+        DataSet data_set = {{{30.1}, (int64_t)30}, {{90.6}, (int64_t)91}, 
{{Null()}, Null()},
+                            {{0.0}, (int64_t)0},   {{-1.1}, (int64_t)-1}, 
{{-60.7}, (int64_t)-61}};
 
         vectorized::check_function<vectorized::DataTypeInt64, true>(func_name, 
input_types,
                                                                     data_set);
@@ -358,12 +354,8 @@ TEST(MathFunctionTest, round_test) {
         std::vector<std::any> input_types = {vectorized::TypeIndex::Float64,
                                              vectorized::TypeIndex::Int32};
 
-        DataSet data_set = {{{3.1415926, 2}, 3.14},
-                            {{3.1415926, 3}, 3.142},
-                            {{Null(), -2}, Null()},
-                            {{193.0, -2}, 200.0},
-                            {{193.0, -1}, 190.0},
-                            {{193.0, -3}, 0.0}};
+        DataSet data_set = {{{3.1415926, 2}, 3.14}, {{3.1415926, 3}, 3.142}, 
{{Null(), -2}, Null()},
+                            {{193.0, -2}, 200.0},   {{193.0, -1}, 190.0},    
{{193.0, -3}, 0.0}};
 
         vectorized::check_function<vectorized::DataTypeFloat64, 
true>(func_name, input_types,
                                                                       
data_set);
@@ -375,9 +367,9 @@ TEST(MathFunctionTest, bin_test) {
 
     std::vector<std::any> input_types = {vectorized::TypeIndex::Int64};
 
-    DataSet data_set = {{{(int64_t) 10}, std::string("1010")},
-                        {{(int64_t) 1}, std::string("1")},
-                        {{(int64_t) 0}, std::string("0")},
+    DataSet data_set = {{{(int64_t)10}, std::string("1010")},
+                        {{(int64_t)1}, std::string("1")},
+                        {{(int64_t)0}, std::string("0")},
                         {{Null()}, Null()}};
 
     vectorized::check_function<vectorized::DataTypeString, true>(func_name, 
input_types, data_set);
@@ -385,7 +377,7 @@ TEST(MathFunctionTest, bin_test) {
 
 TEST(MathFunctionTest, hex_test) {
     std::string func_name = "hex"; // hex(int)
-    
+
     std::vector<std::any> input_types = {vectorized::TypeIndex::Int64};
 
     DataSet data_set = {{{Null()}, Null()},
@@ -413,8 +405,9 @@ TEST(MathFunctionTest, random_test) {
 
     for (const auto& data : data_set) {
         DataSet data_line = {data};
-        vectorized::check_function<vectorized::DataTypeFloat64, 
true>(func_name, input_types, data_line);
-     }
+        vectorized::check_function<vectorized::DataTypeFloat64, 
true>(func_name, input_types,
+                                                                      
data_line);
+    }
 }
 
 } // namespace doris
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java
index aa3662f..2ee2618 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java
@@ -91,7 +91,7 @@ public class HashJoinNode extends PlanNode {
             if (joinOp.equals(JoinOperator.LEFT_ANTI_JOIN) || 
joinOp.equals(JoinOperator.LEFT_SEMI_JOIN)
                     || joinOp.equals(JoinOperator.NULL_AWARE_LEFT_ANTI_JOIN)) {
                 tupleIds.addAll(outer.getTupleIds());
-            } else if (joinOp.equals(JoinOperator.RIGHT_ANTI_JOIN) || 
joinOp.equals(JoinOperator.RIGHT_SEMI_JOIN)){
+            } else if (joinOp.equals(JoinOperator.RIGHT_ANTI_JOIN) || 
joinOp.equals(JoinOperator.RIGHT_SEMI_JOIN)) {
                 tupleIds.addAll(inner.getTupleIds());
             } else {
                 tupleIds.addAll(outer.getTupleIds());
diff --git a/fe/fe-core/src/test/java/org/apache/doris/qe/CoordinatorTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/qe/CoordinatorTest.java
index 3f7e923..fb86df6 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/qe/CoordinatorTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/qe/CoordinatorTest.java
@@ -19,6 +19,7 @@ package org.apache.doris.qe;
 
 import org.apache.doris.analysis.Analyzer;
 import org.apache.doris.analysis.BinaryPredicate;
+import org.apache.doris.analysis.BoolLiteral;
 import org.apache.doris.analysis.Expr;
 import org.apache.doris.analysis.TableRef;
 import org.apache.doris.analysis.TupleDescriptor;
@@ -162,11 +163,15 @@ public class CoordinatorTest extends Coordinator {
         tupleIdArrayList.add(testTupleId);
 
         ArrayList<Expr> testJoinexprs = new ArrayList<>();
-        BinaryPredicate binaryPredicate = new BinaryPredicate();
+
+        BinaryPredicate binaryPredicate = new 
BinaryPredicate(BinaryPredicate.Operator.EQ, new BoolLiteral(true),
+                        new BoolLiteral(true));
         testJoinexprs.add(binaryPredicate);
 
         HashJoinNode hashJoinNode = new HashJoinNode(testPlanNodeId, new 
EmptySetNode(testPlanNodeId, tupleIdArrayList),
-                new EmptySetNode(testPlanNodeId, tupleIdArrayList), new 
TableRef(), testJoinexprs, new ArrayList<>());
+                        new EmptySetNode(testPlanNodeId, tupleIdArrayList), 
new TableRef(), testJoinexprs,
+                        new ArrayList<>());
+
         hashJoinNode.setFragment(new PlanFragment(new PlanFragmentId(-1), 
hashJoinNode,
                 new 
DataPartition(TPartitionType.BUCKET_SHFFULE_HASH_PARTITIONED, testJoinexprs)));
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to