HappenLee commented on code in PR #65482:
URL: https://github.com/apache/doris/pull/65482#discussion_r3581298049


##########
be/src/exec/pipeline/pipeline_fragment_context.cpp:
##########
@@ -1519,9 +1519,24 @@ Status 
PipelineFragmentContext::_create_operator(ObjectPool* pool, const TPlanNo
     bool fe_with_old_version = false;
     switch (tnode.node_type) {
     case TPlanNodeType::OLAP_SCAN_NODE: {
+        std::shared_ptr<QueryCacheRuntime> query_cache_runtime;
+        if (enable_query_cache) {
+            if (_query_cache_runtime == nullptr) {
+                _query_cache_runtime =
+                        
std::make_shared<QueryCacheRuntime>(_params.fragment.query_cache_param);
+            }
+            if (tnode.olap_scan_node.__isset.read_row_binlog &&
+                tnode.olap_scan_node.read_row_binlog) {
+                // Row-binlog scans read a different data stream: they must
+                // neither serve nor fill the query cache.
+                _query_cache_runtime->disable_for_binlog_scan();
+            }
+            query_cache_runtime = _query_cache_runtime;
+        }
         op = std::make_shared<OlapScanOperatorX>(
                 pool, tnode, next_operator_id(), descs, _num_instances,
-                enable_query_cache ? _params.fragment.query_cache_param : 
TQueryCacheParam {});
+                enable_query_cache ? _params.fragment.query_cache_param : 
TQueryCacheParam {},
+                std::move(query_cache_runtime));

Review Comment:
   why _query_cache_runtime ?



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