Sort
Sorts rows
Processing
The step sorts incoming rows according to user-supplied ordering criteria.
Settings
Name | Type | Description |
---|---|---|
In Memory Capacity |
long |
The amount of rows the step should sort in memory. If more than this number of rows need to be sorted, the step falls back to a disk-based merge sort algorithm. Evaluated once when step initializes |
Temp Folder |
string |
The temp folder to create files in when temp files are needed. If no value is provided, the temp directory indicated by the operating system is used. Evaluated once when step initializes |
Sort by
Defines sorting order.
- Subject
- Evaluated for each input row
The subject to sort by, usually an incoming field. - Comparator
- Evaluated once when step initializes
Specifies the sort order. You can specify a comparator in the following ways:- Use one of the comparators available in the morph context menu.
- Supply a function
(a, b) -> long
that receives two subject values and returns:-1
ifa
should be sorted beforeb
1
ifa
should be sorted afterb
0
ifa
andb
are considered equal in sort order
- Direction
- Evaluated once when step initializes
Specifies sorting direction:ascending
keeps the order of the comparatordescending
inverts the order of the comparatorpresorted
is used for processing optimization, and ignores any comparator- use this to indicate that a change in subject value allows all already accumulated and sorted rows to be released into output
- useful only when specified in first (and possibly consecutive) positions