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

philo 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 30a1b0b18a [GLUTEN-10956][VL] Reduce repeated construction of 
`ArrowProjection` in `ColumnarPartialProjectExec` (#10957)
30a1b0b18a is described below

commit 30a1b0b18acffb3676e330e30c8b59bc24102ff7
Author: Zhen Wang <[email protected]>
AuthorDate: Wed Oct 29 14:01:38 2025 +0800

    [GLUTEN-10956][VL] Reduce repeated construction of `ArrowProjection` in 
`ColumnarPartialProjectExec` (#10957)
---
 .../org/apache/gluten/execution/ColumnarPartialProjectExec.scala | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/backends-velox/src/main/scala/org/apache/gluten/execution/ColumnarPartialProjectExec.scala
 
b/backends-velox/src/main/scala/org/apache/gluten/execution/ColumnarPartialProjectExec.scala
index 8fa33d97a1..144f865ade 100644
--- 
a/backends-velox/src/main/scala/org/apache/gluten/execution/ColumnarPartialProjectExec.scala
+++ 
b/backends-velox/src/main/scala/org/apache/gluten/execution/ColumnarPartialProjectExec.scala
@@ -164,6 +164,10 @@ case class ColumnarPartialProjectExec(projectList: 
Seq[NamedExpression], child:
     child.executeColumnar().mapPartitions {
       batches =>
         val res: Iterator[Iterator[ColumnarBatch]] = new 
Iterator[Iterator[ColumnarBatch]] {
+          // select part of child output and child data
+          val projection: ArrowProjection =
+            ArrowProjection.create(replacedAlias, projectAttributes.toSeq)
+
           override def hasNext: Boolean = batches.hasNext
 
           override def next(): Iterator[ColumnarBatch] = {
@@ -175,7 +179,7 @@ case class ColumnarPartialProjectExec(projectList: 
Seq[NamedExpression], child:
               val childData = ColumnarBatches
                 .select(BackendsApiManager.getBackendName, batch, 
projectIndexInChild.toArray)
               try {
-                val projectedBatch = getProjectedBatchArrow(childData, c2a, 
a2c)
+                val projectedBatch = getProjectedBatchArrow(childData, 
projection, c2a, a2c)
                 val batchIterator = projectedBatch.map {
                   b =>
                     if (b.numCols() != 0) {
@@ -208,10 +212,9 @@ case class ColumnarPartialProjectExec(projectList: 
Seq[NamedExpression], child:
 
   private def getProjectedBatchArrow(
       childData: ColumnarBatch,
+      proj: ArrowProjection,
       c2a: SQLMetric,
       a2c: SQLMetric): Iterator[ColumnarBatch] = {
-    // select part of child output and child data
-    val proj = ArrowProjection.create(replacedAlias, projectAttributes.toSeq)
     val numRows = childData.numRows()
     val start = System.currentTimeMillis()
     val sparkColumnarBatch = if (childData.numCols() == 0) {


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

Reply via email to