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/05/11 08:26:59 UTC

[GitHub] [incubator-doris] jacktengg commented on a diff in pull request #9500: [fix](storage) fix core for string predicate in storage layer

jacktengg commented on code in PR #9500:
URL: https://github.com/apache/incubator-doris/pull/9500#discussion_r870016316


##########
be/src/vec/columns/predicate_column.h:
##########
@@ -230,17 +230,36 @@ class PredicateColumnType final : public COWHelper<IColumn, PredicateColumnType<
     void insert_many_binary_data(char* data_array, uint32_t* len_array,
                                  uint32_t* start_offset_array, size_t num) override {
         if constexpr (std::is_same_v<T, StringValue>) {
+            if (!_is_mem_pool_inited) {
+                _pool.reset(new MemPool("PredicateStringColumn"));
+                _is_mem_pool_inited = true;
+            }
+
+            size_t total_mem_size = 0;
+            for (size_t i = 0; i < num; i++) {
+                total_mem_size += len_array[i];
+            }
+            
+            char* destination = (char*)_pool->allocate(total_mem_size);
             for (size_t i = 0; i < num; i++) {
                 uint32_t len = len_array[i];
                 uint32_t start_offset = start_offset_array[i];
-                insert_string_value(data_array + start_offset, len);
+                memcpy(destination, data_array + start_offset, len);

Review Comment:
   Not sure how much performnce will be impacted by allocate and memcpy here.



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