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

    https://github.com/apache/drill/pull/454#discussion_r58057778
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java
 ---
    @@ -110,11 +111,12 @@
       private LinkedList<BatchGroup> batchGroups = Lists.newLinkedList();
       private LinkedList<BatchGroup> spilledBatchGroups = 
Lists.newLinkedList();
       private SelectionVector4 sv4;
    -  private FileSystem fs;
    +  private static FileSystem fs;
    --- End diff --
    
    It was my first decision to put `closeSpillFileSystem` into close(). But it 
in this case we can have failed query when one leaf fragment executes `close()` 
and delete spill folder while another leaf fragment still spooling to the disk.
    That's why we need to delete the spill folder only when root fragment 
(foreman) is closed.
    And `fs` is initialized only once that's why every instance of class uses 
the same FileSystem.
    If I am right one drillbit can perform only one query at the same time. And 
another drillbit performing an external sort uses own static FileSystem 
instance. 



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