Zand100 commented on code in PR #7902:
URL: https://github.com/apache/incubator-gluten/pull/7902#discussion_r1839274420


##########
backends-velox/src/main/scala/org/apache/spark/sql/execution/ColumnarBuildSideRelation.scala:
##########
@@ -60,15 +60,16 @@ case class ColumnarBuildSideRelation(output: 
Seq[Attribute], batches: Array[Arra
         var batchId = 0
 
         override def hasNext: Boolean = {
-          batchId < batches.length
+          batchId < batches.getLength
         }
 
         override def next: ColumnarBatch = {
-          val handle =
-            jniWrapper
-              .deserialize(serializeHandle, batches(batchId))
+          val batch = batches.get(batchId)
+          val columnVector = new OffHeapColumnVector(batch.numElements(), 
DataTypes.BinaryType)
+          columnVector.putByteArray(batchId, batch.toByteArray, 
batch.getBaseOffset.toInt, batch.numElements)
+          val columnarBatch = new ColumnarBatch(Array(columnVector))

Review Comment:
   @zhztheplayer Is it alright to create the `ColumnarBatch` this way, using 
`OffHeapColumnVector` and constructing a new `ColumnarBatch` directly from 
that? 



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