github-actions[bot] commented on code in PR #65548:
URL: https://github.com/apache/doris/pull/65548#discussion_r3593029405


##########
be/src/format_v2/table_reader.h:
##########
@@ -979,7 +997,31 @@ class TableReader {
             return false;
         }
         if (agg_type == TPushAggOp::type::COUNT) {
-            return true;
+            // Old FEs do not serialize push_down_count_slot_ids. During the 
supported BE-first
+            // rolling upgrade, nullopt therefore means "COUNT semantics are 
unknown", not
+            // COUNT(*). Fall back to reading rows until the FE explicitly 
sends either an empty
+            // list for COUNT(*) or one slot for COUNT(col).
+            if (!_push_down_count_columns.has_value()) {
+                return false;
+            }
+            // COUNT(*) needs no column metadata. COUNT(col) currently 
supports one direct file
+            // column; multiple COUNT arguments fall back to the normal scan 
so every upper
+            // aggregate receives the original rows.
+            if (_push_down_count_columns->empty()) {
+                return true;
+            }
+            if (_push_down_count_columns->size() != 1) {

Review Comment:
   The new `size() != 1` and mapping guards deliberately fall back to normal 
row materialization, but V2's `_should_run_adaptive_batch_size()` still 
disables the default-on predictor whenever the raw opcode is COUNT. For 
`COUNT(required_array_a), COUNT(required_array_b)`, this branch decodes both 
potentially wide arrays while skipping the 32-row probe and every predictor 
update, so it uses the fixed runtime batch size and can inflate scan-block 
memory. V1 keys this decision off its effective COUNT mode and does not have 
this mismatch. Please make V2 suppress adaptation only while metadata/synthetic 
COUNT is actually active (or at least enable it for guaranteed fallback 
states), and cover a fallback scan in tests.



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

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