cxzl25 commented on a change in pull request #26323: [SPARK-29657][CORE]
Iterator spill supporting radix sort with null prefix
URL: https://github.com/apache/spark/pull/26323#discussion_r348488825
##########
File path:
core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
##########
@@ -518,19 +520,52 @@ public int getNumRecords() {
public long spill() throws IOException {
Review comment:
Before [SPARK-14851](https://issues.apache.org/jira/browse/SPARK-14851),
```UnsafeInMemorySorter.getSortedIterator()```, the returned type is
```UnsafeInMemorySorter.SortedIterator```.
Now, when the radio sort is turned on and there are some empty values, the
return type is
```UnsafeExternalSorter.ChainedIterator(UnsafeInMemorySorter.SortedIterator)```.
In ```UnsafeExternalSorter.SpillableIterator#spill```, this situation cannot
be spilled.
When ```UnsafeExternalSorter#getSortedIterator``` is called, part of the
last written data is saved in memory.
When the task needs more execution memory, the spill fails.
TaskMemoryManager#acquireExecutionMemory->UnsafeExternalSorter#spill->UnsafeExternalSorter.SpillableIterator#spill
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]