Gabriel39 commented on code in PR #13125: URL: https://github.com/apache/doris/pull/13125#discussion_r990128509
########## be/src/vec/core/sort_block.h: ########## @@ -259,15 +261,25 @@ class ColumnSorter { flags[not_null_range.first] = 0; } if (is_null_range.first < is_null_range.second) { + // do not sort null values std::fill(flags.begin() + is_null_range.first, - flags.begin() + is_null_range.second, 1); + flags.begin() + is_null_range.second, 0); - flags[is_null_range.first] = 0; + if (_limit > is_null_range.first && _limit <= is_null_range.second) { + _limit = is_null_range.second; Review Comment: `_limit > is_null_range.first && _limit <= is_null_range.second` will be true only once so I think this line is trival and can be removed -- 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