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/10/07 14:04:42 UTC
[GitHub] [doris] Gabriel39 commented on a diff in pull request #13125: [fix](sort) fix nullable column sorting incorrectly
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-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