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 f38e72f5 GH-859: Fix ARROW_STRUCT_CONFLICT_POLICY env var (#860)
f38e72f5 is described below

commit f38e72f5a46e30f44c28ff407eb522a5e5c266c0
Author: Zhen Wang <[email protected]>
AuthorDate: Fri Sep 26 09:21:33 2025 +0800

    GH-859: Fix ARROW_STRUCT_CONFLICT_POLICY env var (#860)
    
    ## What's Changed
    
    Do not specify default value when getting the
    `arrow.struct.conflict.policy` property
    
    Closes #859
---
 .../org/apache/arrow/vector/complex/AbstractStructVector.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/vector/src/main/java/org/apache/arrow/vector/complex/AbstractStructVector.java
 
b/vector/src/main/java/org/apache/arrow/vector/complex/AbstractStructVector.java
index 2921e43c..a57fbe47 100644
--- 
a/vector/src/main/java/org/apache/arrow/vector/complex/AbstractStructVector.java
+++ 
b/vector/src/main/java/org/apache/arrow/vector/complex/AbstractStructVector.java
@@ -46,11 +46,13 @@ public abstract class AbstractStructVector extends 
AbstractContainerVector {
   private ConflictPolicy conflictPolicy;
 
   static {
-    String conflictPolicyStr =
-        System.getProperty(STRUCT_CONFLICT_POLICY_JVM, 
ConflictPolicy.CONFLICT_REPLACE.toString());
+    String conflictPolicyStr = System.getProperty(STRUCT_CONFLICT_POLICY_JVM);
     if (conflictPolicyStr == null) {
       conflictPolicyStr = System.getenv(STRUCT_CONFLICT_POLICY_ENV);
     }
+    if (conflictPolicyStr == null) {
+      conflictPolicyStr = ConflictPolicy.CONFLICT_REPLACE.toString();
+    }
     ConflictPolicy conflictPolicy;
     try {
       conflictPolicy = 
ConflictPolicy.valueOf(conflictPolicyStr.toUpperCase(Locale.ROOT));
@@ -62,11 +64,11 @@ public abstract class AbstractStructVector extends 
AbstractContainerVector {
 
   /** Policy to determine how to react when duplicate columns are encountered. 
*/
   public enum ConflictPolicy {
-    // Ignore the conflict and append the field. This is the default behaviour
+    // Ignore the conflict and append the field.
     CONFLICT_APPEND,
     // Keep the existing field and ignore the newer one.
     CONFLICT_IGNORE,
-    // Replace the existing field with the newer one.
+    // Replace the existing field with the newer one. This is the default 
behaviour
     CONFLICT_REPLACE,
     // Refuse the new field and error out.
     CONFLICT_ERROR

Reply via email to