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


##########
be/src/exec/scan/file_scanner_v2.cpp:
##########
@@ -462,6 +495,21 @@ Status FileScannerV2::_init_table_reader(const 
TFileRangeDesc& range) {
 
     VExprContextSPtrs table_conjuncts;
     RETURN_IF_ERROR(_build_table_conjuncts(&table_conjuncts));
+    std::optional<std::vector<format::GlobalIndex>> push_down_count_columns;
+    const auto& push_down_count_slot_ids = 
_local_state->get_push_down_count_slot_ids();
+    if (push_down_count_slot_ids.has_value()) {
+        push_down_count_columns.emplace();
+        push_down_count_columns->reserve(push_down_count_slot_ids->size());
+        for (const auto slot_id : *push_down_count_slot_ids) {
+            const auto global_index_it = 
_slot_id_to_global_index.find(slot_id);
+            if (global_index_it == _slot_id_to_global_index.end()) {
+                return Status::InternalError(
+                        "Pushed-down COUNT argument is not a projected file 
scan slot, slot_id={}",
+                        slot_id);
+            }
+            push_down_count_columns->push_back(global_index_it->second);
+        }
+    }
     RETURN_IF_ERROR(_table_reader->init({
             .projected_columns = _projected_columns,

Review Comment:
   [P2] Forward COUNT semantics into Hudi's active child reader. Native Hudi 
COW scans advertise Parquet/ORC, so they select FileScannerV2 and construct 
`HudiHybridReader`; this line initializes only that outer object. 
`_init_child_reader()` forwards `_push_down_agg_type` but not 
`_push_down_count_columns`, so the child sees `nullopt` and the new old-FE 
safety gate rejects metadata COUNT. This regresses ordinary Hudi COW `COUNT(*)` 
(and safe direct `COUNT(col)`) from footer aggregation to a full row scan. 
Please pass the optional argument state to the child and delegate/mirror 
`current_split_uses_metadata_count()` so restored synthetic rows are not fed to 
adaptive sizing.



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