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/24 02:29:38 UTC

[GitHub] [incubator-doris] HappenLee commented on a diff in pull request #9734: [Bug] [Vectorized] add padding when load char type data

HappenLee commented on code in PR #9734:
URL: https://github.com/apache/incubator-doris/pull/9734#discussion_r880003279


##########
be/src/vec/olap/olap_data_convertor.h:
##########
@@ -99,8 +102,41 @@ class OlapBlockDataConvertor {
         Status convert_to_olap() override;
 
     private:
+        static bool should_padding(const ColumnString* column, size_t padding_length) {
+            // Check sum of data length, including terminating zero.
+            return column->size() * (padding_length + 1) != column->chars.size();
+        }
+
+        static void insert_data_padded(ColumnString* column, StringRef str, size_t padding_length) {
+            const size_t old_size = column->chars.size();
+            const size_t data_size = old_size + str.size;
+            const size_t full_size = old_size + padding_length + 1;
+
+            column->chars.resize(full_size);

Review Comment:
   not do the work in `insert_data_padded`



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