advancedxy commented on code in PR #246:
URL: 
https://github.com/apache/arrow-datafusion-comet/pull/246#discussion_r1555201096


##########
spark/src/main/scala/org/apache/spark/shuffle/sort/RowPartition.scala:
##########
@@ -32,8 +32,17 @@ class RowPartition(initialSize: Int) {
 
   def getNumRows: Int = rowAddresses.size
 
-  def getRowAddresses: Array[Long] = rowAddresses.toArray
-  def getRowSizes: Array[Int] = rowSizes.toArray
+  def getRowAddresses: Array[Long] = {
+    val array = rowAddresses.toArray
+    rowAddresses = null
+    array
+  }
+
+  def getRowSizes: Array[Int] = {
+    val array = rowSizes.toArray
+    rowSizes = null
+    array
+  }

Review Comment:
   > They won't be accessed again after getRowAddresses and getRowSizes get 
called
   
   I see. Maybe I'm being nitpicking. I think caller would be surprise to see 
the state change of `RowPartition` after calling a getter method.  A more 
appropriate method name or some comments would help.



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

Reply via email to