wecharyu commented on code in PR #13626:
URL: https://github.com/apache/gluten/pull/13626#discussion_r4751068560
##########
backends-velox/src/main/scala/org/apache/gluten/execution/ColumnarPartialProjectExec.scala:
##########
@@ -329,6 +335,9 @@ object ColumnarPartialProjectExec {
replaceByAlias(h, replacedAlias)
case e if isBlacklistExpression(e) =>
replaceByAlias(e, replacedAlias)
+ case e if e.children.exists(_.isInstanceOf[LambdaFunction]) =>
Review Comment:
Good insight! I narrowed the aliasing rule so that the offloadable
`transform(arr, x -> x + 1)` stays in Velox, and added test to cover this case.
##########
backends-velox/src/main/scala/org/apache/gluten/execution/ColumnarPartialProjectExec.scala:
##########
@@ -231,9 +231,15 @@ case class ColumnarPartialProjectExec(projectList:
Seq[Expression], child: Spark
val schema =
ExpressionUtils.structFromAttributes(replacedAlias.map(_.toAttribute))
- val targetBatch = ArrowColumnVectors.fromRows(
- schema,
- (0 until numRows).iterator.map(i => proj(sparkColumnarBatch.getRow(i))))
+ val rows = (0 until numRows).iterator.map(sparkColumnarBatch.getRow)
+ val inputRows = 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.
+ val toUnsafe = UnsafeProjection.create(projectAttributes.toSeq,
projectAttributes.toSeq)
Review Comment:
Addressed.
--
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]