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


##########
be/src/exec/scan/file_scanner.cpp:
##########
@@ -1748,11 +1757,105 @@ Status FileScanner::_init_expr_ctxes() {
     return Status::OK();
 }
 
+bool FileScanner::_should_enable_condition_cache() {
+    return _condition_cache_digest != 0 && !_is_load &&
+           (!_conjuncts.empty() || !_push_down_conjuncts.empty());
+}
+
+void FileScanner::_init_reader_condition_cache() {
+    _condition_cache_hit = false;
+    _condition_cache = nullptr;
+    _condition_cache_ctx = nullptr;
+
+    if (!_should_enable_condition_cache() || !_cur_reader) {
+        return;
+    }
+
+    // Disable condition cache when delete operations exist (e.g. Iceberg 
position/equality
+    // deletes, Hive ACID deletes). Cached granule results may become stale if 
delete files
+    // change between queries while the data file's cache key remains the same.
+    if (_cur_reader->has_delete_operations()) {
+        return;
+    }
+
+    auto* cache = segment_v2::ConditionCache::instance();
+    segment_v2::ConditionCache::ExternalCacheKey cache_key(

Review Comment:
   why keep the cache_key with param of FileScanner



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