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

    https://github.com/apache/drill/pull/778#discussion_r105520793
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/managed/PriorityQueueCopierTemplate.java
 ---
    @@ -57,9 +57,12 @@ public void setup(FragmentContext context, 
BufferAllocator allocator, VectorAcce
     
         queueSize = 0;
         for (int i = 0; i < size; i++) {
    -      vector4.set(i, i, batchGroups.get(i).getNextIndex());
    -      siftUp();
    -      queueSize++;
    +      int index = batchGroups.get(i).getNextIndex();
    +      vector4.set(i, i, index);
    --- End diff --
    
    If the record batch is empty, why set this (65535) value in the vector ?
    Probably usually the empty batch is last, so queueSize would not be 
incremented; otherwise if the next iteration brings a non empty batch, then 
siftUp() may run into that 65535 .... (not sure ...)



---
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