huangmengbin commented on a change in pull request #6099: URL: https://github.com/apache/incubator-doris/pull/6099#discussion_r669421819
########## File path: be/src/olap/reader.cpp ########## @@ -548,14 +549,36 @@ OLAPStatus Reader::_init_keys_param(const ReaderParams& read_params) { size_t start_key_size = read_params.start_key.size(); _keys_param.start_keys.resize(start_key_size, nullptr); + + size_t scan_key_size = read_params.start_key.front().size(); + if (scan_key_size > _tablet->tablet_schema().num_columns()) { + LOG(WARNING) + << "Input param are invalid. Column count is bigger than num_columns of schema. " + << "column_count=" << scan_key_size + << ", schema.num_columns=" << _tablet->tablet_schema().num_columns(); + return OLAP_ERR_INPUT_PARAMETER_ERROR; + } + + std::vector<uint32_t> columns; + for (size_t i = 0; i < scan_key_size; ++i) { + columns.push_back(i); + } Review comment: > it is better to extract those to a function, this is duplicted with line 158 - Done. - I used the std::iota to replace the for-loop. - Do I need to extra the "if (scan_key_size > _tablet->tablet_schema().num_columns()) { LOG(WARNING)...." to a function, and wrap it in the macro "RETURN_NOT_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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org