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

    https://github.com/apache/spark/pull/12490#discussion_r60268804
  
    --- Diff: 
sql/core/src/main/java/org/apache/spark/sql/execution/UnsafeKVExternalSorter.java
 ---
    @@ -85,13 +85,15 @@ public UnsafeKVExternalSorter(
             recordComparator,
             prefixComparator,
             /* initialSize */ 4096,
    -        pageSizeBytes);
    +        pageSizeBytes,
    +        keySchema.length() == 1 && 
SortPrefixUtils.canSortFullyWithPrefix(keySchema.apply(0)));
         } else {
           // During spilling, the array in map will not be used, so we can 
borrow that and use it
           // as the underline array for in-memory sorter (it's always large 
enough).
           // Since we will not grow the array, it's fine to pass `null` as 
consumer.
           final UnsafeInMemorySorter inMemSorter = new UnsafeInMemorySorter(
    -        null, taskMemoryManager, recordComparator, prefixComparator, 
map.getArray());
    +        null, taskMemoryManager, recordComparator, prefixComparator, 
map.getArray(),
    +        false /* TODO(ekl) is there enough existing memory to do radix 
sort here? */);
    --- End diff --
    
    I suppose we can't fallback to Tim sort in an elegant way?


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

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

Reply via email to