BiteTheDDDDt commented on a change in pull request #8090:
URL: https://github.com/apache/incubator-doris/pull/8090#discussion_r807805187



##########
File path: be/src/vec/exec/join/join_op.h
##########
@@ -22,19 +22,42 @@
 #include "vec/core/block.h"
 
 namespace doris::vectorized {
+
 /// Reference to the row in block.
 struct RowRef {
     using SizeT = uint32_t; /// Do not use size_t cause of memory economy
 
-    const Block* block = nullptr;
-    SizeT row_num = 0;
-    // Use in right join to mark row is visited
-    // TODO: opt the varaible to use it only need
-    bool visited = false;
+    // using union to represent two cases
+    // 1. when RowRefList containing only one RowRef, visited + blockptr are 
valid
+    // 2. when RowRefList contaning multi RowRef, it's used through next 
pointer
+    union { 
+        struct {
+            uint64_t visited : 1;

Review comment:
       Why is it defined as uint64 here, not use automatic memory alignment?

##########
File path: be/src/vec/exec/join/vhash_join_node.cpp
##########
@@ -286,9 +286,12 @@ struct ProcessHashTableProbe {
 
         // use in right join to change visited state after
         // exec the vother join conjunt
-        std::vector<bool*> visited_map;
+        std::vector<void*> visited_map;
         visited_map.reserve(1.2 * _batch_size);
 
+#define visited_map_or(index, value)  do { if (value)  
((RowRef*)visited_map[index])->visited = 1; } while (0)

Review comment:
       The macros in our code style need uppercase




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to