Ab Initio Component | SORT

 Purpose of SORT Components

 
  • SORT  components sorts and merges records. You can use it to order records before you send them to a component that requires grouped or sorted records. 
  • The SORT components accepts the data from in component in fan-in and all-to-all  flow (for partitioned data). As SORT perform gather operation on its in port so there is no need to gather data before sending to SORT 
  •  Stability in SORT is not guaranteed as the records with identical key values may not maintain their relative order after being sorted. 

 Note:

  • If the key/s on which sorts is being performed contains NULL values, the NULL records are listed first with ascending sort order and last with descending sort order. 
 

Parameters for SORT 

 
key (key specifier, required) 
 
  • Name of the key(s) field(s) and the sequence specifier(s) you want the component to use when it orders records. 
 
 max-core (integer, required)
 
  • You can set this paramter to Maximum memory usage in bytes.
    Default is 100663296 (96 MB). 


Runtime behavior of SORT

 SORT Components perform the following operation:
 
1. SORT Component reads the records from all flows connected to the in port and splits it into temporary files that are smaller in size than the number of bytes specified by the max-core parameter . 

2. Sorts the records in each temporary file according to the sort key.

3. SORT stores any temporary files in the working directories specified in its layout.

4. Repeats steps 1 and 2 until it has read all records.
 
5. Merges all temporary files, maintaining the sort order. 
 
6. Writes the result to the out port.


 
 
 
 
 
 
 
 
 
 
 

No comments:

Post a Comment