Github user Ben-Zvi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/808#discussion_r118407555
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/managed/ExternalSortBatch.java
 ---
    @@ -672,50 +350,74 @@ private IterOutcome load() {
     
         // Anything to actually sort?
     
    -    if (inputRecordCount == 0) {
    +    resultsIterator = sortImpl.startMerge();
    +    if (! resultsIterator.next()) {
           sortState = SortState.DONE;
           return IterOutcome.NONE;
         }
    -    logger.debug("Completed load phase: read {} batches, spilled {} times, 
total input bytes: {}",
    -                 inputBatchCount, spilledRuns.size(), totalInputBytes);
     
    -    // Do the merge of the loaded batches. The merge can be done entirely 
in memory if
    -    // the results fit; else we have to do a disk-based merge of
    -    // pre-sorted spilled batches.
    +    // sort may have prematurely exited due to should continue returning 
false.
    --- End diff --
    
    This comment is a little confusing ...  due to ? ..... return false or 
return STOP ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to