viirya commented on code in PR #246:
URL:
https://github.com/apache/arrow-datafusion-comet/pull/246#discussion_r1555019827
##########
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. Once they are called, they are exported to native side for spilling.
After that, `RowPartition` will be reset.
--
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]