levy5307 commented on a change in pull request #8292:
URL: https://github.com/apache/incubator-doris/pull/8292#discussion_r817516069
##########
File path: be/src/vec/columns/column_string.h
##########
@@ -165,10 +167,33 @@ class ColumnString final : public COWHelper<IColumn,
ColumnString> {
}
};
- void insert_many_dict_data(const int32_t* data_array, size_t start_index,
const StringRef* dict, size_t num) override {
- for (size_t end_index = start_index+num; start_index < end_index;
++start_index) {
- int32_t codeword = data_array[start_index];
- insert_data(dict[codeword].data, dict[codeword].size);
+ void insert_many_dict_data(const int32_t* __restrict data_array, size_t
start_index, const StringRef* __restrict dict, size_t num) override {
+ size_t index = start_index;
+ const size_t end = start_index + num;
+
+ // handle offsets
+ size_t old_size = offsets.size();
+ offsets.resize(old_size + num);
+
+ size_t chars_old_size = chars.size();
+ size_t chars_new_size = chars_old_size;
+ for (; index < end; ++index) {
+ int32_t codeword = data_array[index];
+ chars_new_size += (dict[codeword].size + 1); // extra 1 for zero
ending
+ offsets[old_size++] = chars_new_size;
+ }
+
+ // handle chars
+ chars.resize(chars_new_size);
+ unsigned char* c_data = chars.data();
+
+ index = start_index;
Review comment:
```
index = start_index;
for (; index < end; ++index)
```
==>
```for (index = start_index; index < end; ++index)```
--
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]