augustoasilva commented on a change in pull request #11193:
URL: https://github.com/apache/arrow/pull/11193#discussion_r732339275
##########
File path: cpp/src/gandiva/llvm_generator.h
##########
@@ -49,14 +51,41 @@ class GANDIVA_EXPORT LLVMGenerator {
static Status Make(std::shared_ptr<Configuration> config,
std::unique_ptr<LLVMGenerator>* llvm_generator);
- /// \brief Build the code for the expression trees for default mode. Each
- /// element in the vector represents an expression tree
- Status Build(const ExpressionVector& exprs, SelectionVector::Mode mode);
+ static std::shared_ptr<Cache<ExpressionCacheKey,
std::shared_ptr<llvm::MemoryBuffer>>>
+ GetCache();
+
+ /// \brief Build the code for the expression trees for default mode with a
LLVM
+ /// ObjectCache. Each element in the vector represents an expression tree
+ template <class KeyType>
+ Status Build(const ExpressionVector& exprs, SelectionVector::Mode mode,
+ GandivaObjectCache<KeyType>& obj_cache) {
+ selection_vector_mode_ = mode;
+
+ for (auto& expr : exprs) {
+ auto output = annotator_.AddOutputFieldDescriptor(expr->result());
+ ARROW_RETURN_NOT_OK(Add(expr, output));
+ }
+
+ engine_->SetLLVMObjectCache(obj_cache);
Review comment:
Ok, applied your suggestion, by rolling back to previous implementation
and adding SetLLVMObjectCache to llvm_generator
--
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]