augustoasilva commented on a change in pull request #11193:
URL: https://github.com/apache/arrow/pull/11193#discussion_r732332683



##########
File path: cpp/src/gandiva/filter.cc
##########
@@ -102,14 +46,30 @@ Status Filter::Make(SchemaPtr schema, ConditionPtr 
condition,
   ARROW_RETURN_IF(configuration == nullptr,
                   Status::Invalid("Configuration cannot be null"));
 
-  static Cache<FilterCacheKey, std::shared_ptr<Filter>> cache;
-  FilterCacheKey cache_key(schema, configuration, *(condition.get()));
-  auto cachedFilter = cache.GetModule(cache_key);
-  if (cachedFilter != nullptr) {
-    *filter = cachedFilter;
-    return Status::OK();
+  std::shared_ptr<Cache<ExpressionCacheKey, 
std::shared_ptr<llvm::MemoryBuffer>>>
+      shared_cache = LLVMGenerator::GetCache();
+
+  Condition conditionToKey = *(condition.get());
+
+  ExpressionCacheKey cache_key(schema, configuration, conditionToKey, 
"filter");
+  std::unique_ptr<ExpressionCacheKey> base_cache_key =
+      std::make_unique<ExpressionCacheKey>(cache_key);
+  std::shared_ptr<ExpressionCacheKey> shared_base_cache_key = 
std::move(base_cache_key);
+
+  bool llvm_flag = false;
+
+  std::shared_ptr<llvm::MemoryBuffer> prev_cached_obj;
+  prev_cached_obj = shared_cache->GetObjectCode(*shared_base_cache_key);
+
+  // Verify if previous filter obj code was cached
+  if (prev_cached_obj != nullptr) {
+    ARROW_LOG(DEBUG)
+        << "[DEBUG][CACHE-LOG][INFO]: Filter object code WAS already cached!";

Review comment:
       Just debug, fixed the message




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


Reply via email to