zhangstar333 commented on code in PR #68813:
URL: https://github.com/apache/doris/pull/68813#discussion_r4227910667


##########
be/src/format_v2/table/lance_reader.cpp:
##########
@@ -1197,38 +1084,20 @@ void LanceTableReader::_collect_scan_statistics(void* 
callback_ctx, const void*
             continue;
         }
         const std::string_view name(metric.name == nullptr ? "" : metric.name, 
metric.name_len);
-        RuntimeProfile::Counter* counter = nullptr;
-        switch (metric.kind) {
-        case LANCE_SCAN_METRIC_COUNT: {
-            const auto found = reader->_lance_count_metrics.find(name);
-            if (found != reader->_lance_count_metrics.end()) {
-                counter = found->second;
+        for (const auto& definition : LANCE_SCAN_METRICS) {
+            if (definition.native_name != name) {
+                continue;
             }
-            break;
-        }
-        case LANCE_SCAN_METRIC_TIME_NANOSECONDS: {
-            const auto found = reader->_lance_time_metrics.find(name);
-            if (found != reader->_lance_time_metrics.end()) {
-                counter = found->second;
-            } else if (name == "search_time") {
-                // Scalar-index metrics exist only when Lance includes the 
corresponding
-                // execution node in this scan plan.
-                counter = ADD_CHILD_TIMER_WITH_LEVEL(reader->_scanner_profile,

Review Comment:
   done



##########
docs/lance-prefilter-profile.md:
##########
@@ -32,17 +32,17 @@ vectors use a different loader and are not included in 
these counters.
 
 | Counter | Meaning |
 | --- | --- |
-| `LancePrefilterLoads` | Number of row-ID prefilter loader executions 
started. |
-| `LancePrefilterInputBatches` | Successfully consumed input batches. |
-| `LancePrefilterInputRows` | Non-null input row IDs, including duplicates. |
-| `LancePrefilterRowIds` | Sum of distinct row IDs in successfully completed 
allow sets. |
-| `LancePrefilterLoadTime` | Total loader wall time, including input polling 
and set construction. |
-| `LancePrefilterInputTime` | Wall time polling input batches, including 
upstream execution, I/O, decoding and scheduling. |
-| `LancePrefilterBuildTime` | Wall time inserting row IDs into the allow set, 
measured once per batch. |
+| `RowIdPrefilterLoads` | Number of row-ID prefilter loader executions 
started. |

Review Comment:
   done



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