wecharyu commented on code in PR #13626:
URL: https://github.com/apache/gluten/pull/13626#discussion_r4783869862


##########
backends-velox/src/main/scala/org/apache/gluten/execution/ColumnarPartialProjectExec.scala:
##########
@@ -278,8 +284,7 @@ object ColumnarPartialProjectExec {
   val dummyPrefix = "_dummy"
 
   def validateExpression(expr: Expression): Boolean = {
-    expr.deterministic && !expr.isInstanceOf[LambdaFunction] && expr.children
-      .forall(validateExpression)
+    expr.deterministic

Review Comment:
   Addressed.



##########
backends-velox/src/main/scala/org/apache/gluten/execution/ColumnarPartialProjectExec.scala:
##########
@@ -167,12 +167,19 @@ case class ColumnarPartialProjectExec(projectList: 
Seq[Expression], child: Spark
     val a2c = longMetric("arrow_to_velox_time")
     child.executeColumnar().mapPartitions {
       batches =>
-        val res: Iterator[Iterator[ColumnarBatch]] = new 
Iterator[Iterator[ColumnarBatch]] {
-          // select part of child output and child data
-          val projection: MutableProjection =
-            MutableProjection.create(replacedAlias, projectAttributes.toSeq)
+        val projectRow: InternalRow => InternalRow = {
+          val inputAttributes = projectAttributes.toSeq
+          val projection = MutableProjection.create(replacedAlias, 
inputAttributes)
           projection.initialize(TaskContext.getPartitionId())
-
+          if (replacedAlias.exists(_.exists(_.isInstanceOf[LambdaFunction]))) {
+            // Lambda evaluation needs null-aware array access, which 
ColumnarArray.get lacks.
+            // TODO: Remove this conversion once all supported Spark versions 
handle null elements
+            // correctly in ColumnarArray.get.

Review Comment:
   Make sense, updated the comments.



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


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

Reply via email to