Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19862#discussion_r154568554
  
    --- Diff: 
sql/catalyst/src/main/java/org/apache/spark/sql/execution/UnsafeExternalRowSorter.java
 ---
    @@ -159,6 +154,12 @@ public boolean hasNext() {
             @Override
             public UnsafeRow next() {
               try {
    +            if (!alreadyCalculated) {
    --- End diff --
    
    When `hasNext` is called, doesn't `sortedIterator` return no element 
anymore since we haven't added rows into it?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to