dmitry-chirkov-dremio commented on code in PR #50372:
URL: https://github.com/apache/arrow/pull/50372#discussion_r3581595967


##########
cpp/src/gandiva/projector.cc:
##########
@@ -283,6 +288,10 @@ Status Projector::ValidateArrayDataCapacity(const 
arrow::ArrayData& array_data,
 
 const std::string& Projector::DumpIR() { return llvm_generator_->ir(); }
 
+const std::string& Projector::DumpUnoptimizedIR() {

Review Comment:
   This new API looks unsafe on cache hits. `Projector::Make()` now reuses 
cached object code for more expressions after folding, but on the cached path 
`Engine::FinalizeModule()` never populates `unoptimized_module_ir_`, so 
`DumpUnoptimizedIR()` will DCHECK even when `dump_ir=true`.
   
   Can we either:
   1. make this API explicitly unavailable for cached projectors, or
   2. preserve/store the unoptimized IR alongside the cache entry, or
   3. add a guard/error path here instead of unconditionally delegating?



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