siknezevic commented on a change in pull request #27246:
URL: https://github.com/apache/spark/pull/27246#discussion_r436226277
##########
File path:
core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java
##########
@@ -720,5 +720,14 @@ public void loadNext() throws IOException {
@Override
public long getKeyPrefix() { return current.getKeyPrefix(); }
+
+ private void initializeNumRecords() throws IOException {
+ if (numRecords == 0) {
+ for (UnsafeSorterIterator iter: iterators) {
+ numRecords += iter.getNumRecords();
+ }
+ numRecords += current.getNumRecords();
+ }
+ }
Review comment:
Thank you for the suggestion. It make sense. I will do it and test it.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]