augustoasilva commented on a change in pull request #11193:
URL: https://github.com/apache/arrow/pull/11193#discussion_r732332091
##########
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);
Review comment:
Changed GandivaObjectCache to take an object instead a shared_pointer
--
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]