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/06/20 16:18:25 UTC

[GitHub] [doris] zenoyang commented on a diff in pull request #10084: [feature-wip](vectorized) Support block aggregate in scanner

zenoyang commented on code in PR #10084:
URL: https://github.com/apache/doris/pull/10084#discussion_r901835915


##########
be/src/vec/olap/block_reader.cpp:
##########
@@ -133,6 +133,29 @@ Status BlockReader::init(const ReaderParams& read_params) {
         return status;
     }
 
+    // only group by key num <= 3 and has bitmap_union col, enable block aggregate
+    if (config::enable_block_aggregate_in_scanner && _aggregation &&
+        (_tablet->keys_type() == AGG_KEYS)) {
+        int agg_key_size = 0;
+        for (int i = 0; i < return_column_size; ++i) {
+            auto cid = read_params.origin_return_columns->at(i);
+            auto& col = _tablet->tablet_schema().column(cid);
+            if (col.is_key() && ++agg_key_size > 3) {

Review Comment:
   no. If `col1` and `col2` are both table keys and agg keys, the block we get is aggregated based on all keys in the aggregation table, not based on the group by key column. So `_block_aggregation` still needs to be true



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