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/22 03:53:23 UTC

[GitHub] [incubator-doris] HappenLee commented on a diff in pull request #9716: [Bug] [Bitmap] change to_bitmap to always_not_nullable

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


##########
be/src/vec/functions/function_bitmap.cpp:
##########
@@ -45,17 +45,16 @@ struct ToBitmap {
         auto size = offsets.size();
         res.reserve(size);
         for (size_t i = 0; i < size; ++i) {
+            res.emplace_back();
+
             const char* raw_str = reinterpret_cast<const char*>(&data[offsets[i - 1]]);
             size_t str_size = offsets[i] - offsets[i - 1] - 1;
             StringParser::ParseResult parse_result = StringParser::PARSE_SUCCESS;
             uint64_t int_value = StringParser::string_to_unsigned_int<uint64_t>(raw_str, str_size,
                                                                                 &parse_result);
             if (UNLIKELY(parse_result != StringParser::PARSE_SUCCESS)) {

Review Comment:
   ```suggestion
               if (LIKELY(parse_result == StringParser::PARSE_SUCCESS)) {
                   res.back().add(int_value);
               }
   ```



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