public static UnsafeExternalRowSorter createWithRecordComparator( StructType schema, Supplier<RecordComparator> recordComparatorSupplier, PrefixComparator prefixComparator, PrefixComputer prefixComputer, long pageSizeBytes, boolean canUseRadixSort) throws IOException { return new UnsafeExternalRowSorter(schema, recordComparatorSupplier, prefixComparator, prefixComputer, pageSizeBytes, canUseRadixSort); }
@Override protected Iterator<InternalRow> doExecute() { List<Attribute> childOutput = child.output(); Comparator<InternalRow> ordering = newOrdering(sortOrders, childOutput); // The comparator for comparing prefix SortOrder boundSortExpression = BoundReference.bindReference(sortOrders.get(0), childOutput); PrefixComparator prefixComparator = SortPrefixUtils.getPrefixComparator(boundSortExpression); // The generator for prefix int prefixFiledOrdinal = ((BoundReference) boundSortExpression.child).ordinal; UnsafeExternalRowSorter.PrefixComputer prefixComputer = row -> row.getUniformVal(prefixFiledOrdinal); try { UnsafeExternalRowSorter sorter = new UnsafeExternalRowSorter( schema(), ordering, prefixComparator, prefixComputer, MemoryManager.pageSize); return sorter.sort(child.execute()); } catch (IOException e) { throw new RuntimeException(e); } }
cleanupResources(); cleanupResources(); throw e;
public static UnsafeExternalRowSorter createWithRecordComparator( StructType schema, Supplier<RecordComparator> recordComparatorSupplier, PrefixComparator prefixComparator, PrefixComputer prefixComputer, long pageSizeBytes, boolean canUseRadixSort) throws IOException { return new UnsafeExternalRowSorter(schema, recordComparatorSupplier, prefixComparator, prefixComputer, pageSizeBytes, canUseRadixSort); }
public static UnsafeExternalRowSorter createWithRecordComparator( StructType schema, Supplier<RecordComparator> recordComparatorSupplier, PrefixComparator prefixComparator, PrefixComputer prefixComputer, long pageSizeBytes, boolean canUseRadixSort) throws IOException { return new UnsafeExternalRowSorter(schema, recordComparatorSupplier, prefixComparator, prefixComputer, pageSizeBytes, canUseRadixSort); }
public static UnsafeExternalRowSorter create( StructType schema, Ordering<InternalRow> ordering, PrefixComparator prefixComparator, PrefixComputer prefixComputer, long pageSizeBytes, boolean canUseRadixSort) throws IOException { Supplier<RecordComparator> recordComparatorSupplier = () -> new RowComparator(ordering, schema.length()); return new UnsafeExternalRowSorter(schema, recordComparatorSupplier, prefixComparator, prefixComputer, pageSizeBytes, canUseRadixSort); }
public static UnsafeExternalRowSorter create( StructType schema, Ordering<InternalRow> ordering, PrefixComparator prefixComparator, PrefixComputer prefixComputer, long pageSizeBytes, boolean canUseRadixSort) throws IOException { Supplier<RecordComparator> recordComparatorSupplier = () -> new RowComparator(ordering, schema.length()); return new UnsafeExternalRowSorter(schema, recordComparatorSupplier, prefixComparator, prefixComputer, pageSizeBytes, canUseRadixSort); }
public static UnsafeExternalRowSorter create( StructType schema, Ordering<InternalRow> ordering, PrefixComparator prefixComparator, PrefixComputer prefixComputer, long pageSizeBytes, boolean canUseRadixSort) throws IOException { Supplier<RecordComparator> recordComparatorSupplier = () -> new RowComparator(ordering, schema.length()); return new UnsafeExternalRowSorter(schema, recordComparatorSupplier, prefixComparator, prefixComputer, pageSizeBytes, canUseRadixSort); }