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/16 02:00:26 UTC

[GitHub] [incubator-doris] liaoxin01 commented on pull request #9564: [fix](storage-vectorized) fix VMergeIterator core dump

liaoxin01 commented on PR #9564:
URL: https://github.com/apache/incubator-doris/pull/9564#issuecomment-1127136630

   > whats the difference? please add some comment to explain why use num columnids not columns.size.
   
   @yiguolei num_column_ids indicates the number of columns actually queried. columns.size indicates the size of the schema.  so the num_column_ids is not greater than columns.size. 
   And In block_reset, using num_column_ids to create block.
   
   ```
       Status block_reset() {
           if (!_block) {
               const Schema& schema = _iter->schema();
               const auto& column_ids = schema.column_ids();
               for (size_t i = 0; i < schema.num_column_ids(); ++i) {
                   auto column_desc = schema.column(column_ids[i]);
                   auto data_type = Schema::get_data_type_ptr(*column_desc);
                   if (data_type == nullptr) {
                       return Status::RuntimeError("invalid data type");
                   }
                   auto column = data_type->create_column();
                   column->reserve(_block_row_max);
                   _block.insert(
                           ColumnWithTypeAndName(std::move(column), data_type, column_desc->name()));
               }
           } else {
               _block.clear_column_data();
           }
           return Status::OK();
       }
   ```


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