Mryange commented on code in PR #71340:
URL: https://github.com/apache/doris/pull/71340#discussion_r4794541200


##########
be/src/core/column/column_array.cpp:
##########
@@ -368,30 +368,18 @@ void ColumnArray::update_hash_with_value(size_t n, 
SipHash& hash) const {
 // for every array row calculate xxHash
 void ColumnArray::update_xxHash_with_value(size_t start, size_t end, uint64_t& 
hash,
                                            const uint8_t* __restrict 
null_data) const {
-    auto& offsets_column = get_offsets();
-    if (null_data) {
-        for (size_t i = start; i < end; ++i) {
-            if (null_data[i] == 0) {
-                size_t elem_size = offsets_column[i] - offsets_column[i - 1];
-                if (elem_size == 0) {
-                    hash = HashUtil::xxHash64WithSeed(reinterpret_cast<const 
char*>(&elem_size),
-                                                      sizeof(elem_size), hash);
-                } else {
-                    get_data().update_xxHash_with_value(offsets_column[i - 1], 
offsets_column[i],
-                                                        hash, nullptr);
-                }
-            }
+    const auto& offsets_column = get_offsets();
+    for (size_t i = start; i < end; ++i) {
+        if (null_data && null_data[i] != 0) {
+            continue;
         }
-    } else {
-        for (size_t i = start; i < end; ++i) {
-            size_t elem_size = offsets_column[i] - offsets_column[i - 1];
-            if (elem_size == 0) {
-                hash = HashUtil::xxHash64WithSeed(reinterpret_cast<const 
char*>(&elem_size),
-                                                  sizeof(elem_size), hash);
-            } else {
-                get_data().update_xxHash_with_value(offsets_column[i - 1], 
offsets_column[i], hash,
-                                                    nullptr);
-            }
+
+        const size_t offset = offsets_column[i - 1];
+        const size_t elem_size = offsets_column[i] - offset;
+        hash = HashUtil::xxHash64WithSeed(reinterpret_cast<const 
char*>(&elem_size),

Review Comment:
   multi distinct count我们认为它不会手动调用,只会通过优化器规划出来。所以就不考虑升降级兼容的问题啦。



-- 
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