This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-java.git


The following commit(s) were added to refs/heads/main by this push:
     new 370031e6 GH-601: [Gandiva] Synchronize some methods on the Projector 
(#602)
370031e6 is described below

commit 370031e620da91bda2f00f29b5b8ea962aec9f98
Author: lriggs <[email protected]>
AuthorDate: Thu Feb 20 16:05:08 2025 -0800

    GH-601: [Gandiva] Synchronize some methods on the Projector (#602)
    
    ### Rationale for this change
    Multiple threads can attempt to create the same llvm expression in
    Gandiva. This isn't allowed with the new JIT compiler, so synchronizing
    will prevent this scenario.
    
    ### What changes are included in this PR?
    Synchronize some methods to avoid adding duplicate llvm expressions.
    
    ### Are these changes tested?
    Yes, through unit tests in Gandiva.
    
    ### Are there any user-facing changes?
    No.
    
    Closes GH-601
---
 .../src/main/java/org/apache/arrow/gandiva/evaluator/Projector.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/Projector.java 
b/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/Projector.java
index 5c16c46e..9c5b22d6 100644
--- a/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/Projector.java
+++ b/gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/Projector.java
@@ -188,7 +188,7 @@ public class Projector {
    * @param configurationId Custom configuration created through config 
builder.
    * @return A native evaluator object that can be used to invoke these 
projections on a RecordBatch
    */
-  public static Projector make(
+  public static synchronized Projector make(
       Schema schema,
       List<ExpressionTree> exprs,
       SelectionVectorType selectionVectorType,
@@ -314,7 +314,7 @@ public class Projector {
         outColumns);
   }
 
-  private void evaluate(
+  private synchronized void evaluate(
       int numRows,
       List<ArrowBuf> buffers,
       List<ArrowBuffer> buffersLayout,

Reply via email to