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 2021/04/07 14:59:37 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #5608: [Bug] Fix bug that isPreAggregation is incorrectly set

morningman commented on a change in pull request #5608:
URL: https://github.com/apache/incubator-doris/pull/5608#discussion_r608735903



##########
File path: be/src/olap/reader.cpp
##########
@@ -458,7 +458,8 @@ OLAPStatus Reader::_init_params(const ReaderParams& read_params) {
 OLAPStatus Reader::_init_return_columns(const ReaderParams& read_params) {
     if (read_params.reader_type == READER_QUERY) {
         _return_columns = read_params.return_columns;
-        if (!_delete_handler.empty() && read_params.aggregation) {

Review comment:
       For reviewer:
   Remove `read_params.aggregation` because this is just a tricky optimization.
   That is, if `aggregation` is false, than all key columns has already been added to the `_return_columns`.
   And delete conditions can only be applied on key columns, so no need to iterate and add them again.
   
   But this is not always right, because for DUPLICATION KEY table, the delete conditions can be applied on any columns. Although the query optimizer will guarantee that for  DUPLICATION KEY table, the aggregation is always true, but we should not depend on it.
   




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

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