morningman commented on code in PR #44635:
URL: https://github.com/apache/doris/pull/44635#discussion_r1918080703


##########
be/src/pipeline/exec/scan_operator.cpp:
##########
@@ -979,18 +979,19 @@ Status ScanLocalState<Derived>::_prepare_scanners() {
             scanner->set_query_statistics(_query_statistics.get());
         }
         COUNTER_SET(_num_scanners, static_cast<int64_t>(scanners.size()));
-        RETURN_IF_ERROR(_start_scanners(_scanners));
+        RETURN_IF_ERROR(start_scanners(_scanners));
     }
     return Status::OK();
 }
 
 template <typename Derived>
-Status ScanLocalState<Derived>::_start_scanners(
+Status ScanLocalState<Derived>::start_scanners(

Review Comment:
   The only difference between this and `file_scan_operator` is that 
`file_scan_operator` pass the `query_parallel_instance_num` separately.
   So I suggest to create a new virtual method 
`get_query_parallel_instance_num()`,
   and for `scan_operator`, it returns `state()->query_parallel_instance_num()`.
   For `file_scan_operator`, it returns `_batch_split_mode ? 1 : 
state()->query_parallel_instance_num()`



##########
be/src/pipeline/exec/file_scan_operator.cpp:
##########
@@ -37,9 +38,11 @@ Status 
FileScanLocalState::_init_scanners(std::list<vectorized::VScannerSPtr>* s
     }
 
     auto& p = _parent->cast<FileScanOperatorX>();
-    uint32_t shard_num = std::min(
-            config::doris_scanner_thread_pool_thread_num / 
state()->query_parallel_instance_num(),
-            _max_scanners);
+    // There's only one scan range for each backend in batch split mode. Each 
backend only starts up one ScanNode instance.
+    uint32_t shard_num =
+            std::min(config::doris_scanner_thread_pool_thread_num /
+                             (_batch_split_mode ? 1 : 
state()->query_parallel_instance_num()),

Review Comment:
   I suggest to extract this `_batch_split_mode ? 1 : 
state()->query_parallel_instance_num()` to a method in file scan operator. 



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