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

    https://github.com/apache/drill/pull/454#discussion_r58107846
  
    --- 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 --
    
    I agree with Jacques, except I would probably have one directory per sort 
operator in a fragment, rather one per fragment. This way the ExternalSort 
operator would be responsible for cleaning it up, and we wouldn't have to 
manage it at the Fragment level.
    
    To clarify, right now the spill files for a sort go in a directory with the 
path:
    
    <root spill dir>/<query_id>/<major_frag_id>/<minor_frag_id>/<operator_id>/
    
    Instead we should make it:
    
    <root spill dir>/<query_id>_<major_frag_id>_<minor_frag_id>_<operator_id>/
    
    That way, the sort operator itself will be able to cleanup its own spill 
directory, and there won't be any empty directories left over.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to