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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to