You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/08 15:14:18 UTC

[GitHub] [doris] mrhhsg commented on a diff in pull request #10700: [improvement]pre-serialize aggregation keys

mrhhsg commented on code in PR #10700:
URL: https://github.com/apache/doris/pull/10700#discussion_r916913762


##########
be/src/vec/columns/column_nullable.cpp:
##########
@@ -134,6 +134,24 @@ const char* ColumnNullable::deserialize_and_insert_from_arena(const char* pos) {
     return pos;
 }
 
+size_t ColumnNullable::get_max_row_byte_size() const {
+    constexpr auto flag_size = sizeof(get_null_map_data()[0]);
+    return flag_size + get_nested_column().get_max_row_byte_size();
+}
+
+void ColumnNullable::serialize_vec(std::vector<StringRef>& keys, size_t num_rows,
+                                   size_t max_row_byte_size) const {
+    const auto& arr = get_null_map_data();
+    static constexpr auto s = sizeof(arr[0]);
+    for (size_t i = 0; i < num_rows; ++i) {
+        auto* val = const_cast<char*>(keys[i].data + keys[i].size);
+        *val = (arr[i] ? 1 : 0);

Review Comment:
   Value of `NULL` may be 1 or JOIN_NULL_HINT(2)



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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