WangGuangxin commented on code in PR #10706:
URL: 
https://github.com/apache/incubator-gluten/pull/10706#discussion_r2357305836


##########
gluten-arrow/src/main/java/org/apache/gluten/columnarbatch/ColumnarBatches.java:
##########
@@ -171,6 +172,15 @@ public static void checkOffloaded(ColumnarBatch batch) {
     }
   }
 
+  public static ArrowColumnarBatch convertToArrowColumnarBatch(ColumnarBatch 
sparkColumnarBatch) {
+    int numCols = sparkColumnarBatch.numCols();
+    ArrowWritableColumnVector[] writableColumns = new 
ArrowWritableColumnVector[numCols];
+    for (int i = 0; i < numCols; i++) {
+      writableColumns[i] = (ArrowWritableColumnVector) 
sparkColumnarBatch.column(i);
+    }
+    return new ArrowColumnarBatch(writableColumns, 
sparkColumnarBatch.numRows());

Review Comment:
   do we need to close `sparkColumnarBatch` here?



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