dataroaring commented on code in PR #53540:
URL: https://github.com/apache/doris/pull/53540#discussion_r2259220295


##########
be/src/pipeline/exec/olap_scan_operator.cpp:
##########
@@ -601,9 +601,17 @@ Status OlapScanLocalState::prepare(RuntimeState* state) {
     }
 
     for (size_t i = 0; i < _scan_ranges.size(); i++) {
-        RETURN_IF_ERROR(_tablets[i].tablet->capture_rs_readers({0, 
_tablets[i].version},
-                                                               
&_read_sources[i].rs_splits,
-                                                               
_state->skip_missing_version()));
+        if (config::is_cloud_mode() && 
_state->enable_query_freshness_tolerance()) {
+            
RETURN_IF_ERROR(std::static_pointer_cast<CloudTablet>(_tablets[i].tablet)
+                                    
->capture_rs_readers_with_freshness_tolerance(
+                                            {0, _tablets[i].version}, 
&_read_sources[i].rs_splits,
+                                            _state->skip_missing_version(),
+                                            
_state->query_freshness_tolerance_ms()));
+        } else {
+            RETURN_IF_ERROR(_tablets[i].tablet->capture_rs_readers({0, 
_tablets[i].version},
+                                                                   
&_read_sources[i].rs_splits,
+                                                                   
_state->skip_missing_version()));
+        }

Review Comment:
   Maybe we can add a function capute_rs_readers one of whose arguments is 
state and then move if here into mew capute_rs_readers.



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