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

chengchengjin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 93f7b09ede [GLUTEN-10966][VL][FOLLOWUP] Fix 
UnsupportedOperationException when the result type of expressions in 
GenerateArrowProjection is array (#10986)
93f7b09ede is described below

commit 93f7b09ededed6e9253ead86c409ee285dab47ad
Author: jiangjiangtian <[email protected]>
AuthorDate: Fri Oct 31 18:10:21 2025 +0800

    [GLUTEN-10966][VL][FOLLOWUP] Fix UnsupportedOperationException when the 
result type of expressions in GenerateArrowProjection is array (#10986)
    
    Co-authored-by: jiangtian <[email protected]>
---
 .../apache/gluten/expression/GenerateArrowProjection.scala | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/gluten-arrow/src/main/scala/org/apache/gluten/expression/GenerateArrowProjection.scala
 
b/gluten-arrow/src/main/scala/org/apache/gluten/expression/GenerateArrowProjection.scala
index 71a2c4db08..7128f309d9 100644
--- 
a/gluten-arrow/src/main/scala/org/apache/gluten/expression/GenerateArrowProjection.scala
+++ 
b/gluten-arrow/src/main/scala/org/apache/gluten/expression/GenerateArrowProjection.scala
@@ -88,8 +88,14 @@ object GenerateArrowProjection extends 
CodeGenerator[Seq[Expression], ArrowProje
             FalseLiteral)
         }
         // update value into intermediate
-        val update = CodeGenerator
-          .updateColumn("intermediate", e.dataType, i, ExprCode(isNull, 
value), e.nullable)
+        val update =
+          s"""
+             |if (!$isNull) {
+             |  values[$i] = $value;
+             |} else {
+             |  values[$i] = null;
+             |}
+             |""".stripMargin
         (code, update)
     }
 
@@ -108,13 +114,15 @@ object GenerateArrowProjection extends 
CodeGenerator[Seq[Expression], ArrowProje
 
         private Object[] references;
         private ${classOf[ArrowColumnarRow].getName} mutableRow;
+        private Object[] values;
         private ${classOf[GenericInternalRow].getName} intermediate;
         ${ctx.declareMutableStates()}
 
         public SpecificArrowProjection(Object[] references) {
           this.references = references;
           mutableRow = null;
-          intermediate = new 
${classOf[GenericInternalRow].getName}(${expressions.size});
+          values = new Object[${expressions.size}];
+          intermediate = new ${classOf[GenericInternalRow].getName}(values);
           ${ctx.initMutableStates()}
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to