Sort within group means data is already sorted on major keys and need to get the data sorted on minor keys.But if we already know tht the data is sorted on major keys then why donot we use SORT component and provide the key as {minor keys} in the SORT component? Why go for SORT WITHIN GROUPS

Showing Answers 1 - 3 of 3 Answers

Nikhil M

  • Sep 8th, 2020

sort component read records in memory and sort them until it reach last input records or limit of maxcore parameter. once it reach maxcore limit, it spill data to disk and continue with next set of inputs. And once all records are process, it perform merge operation.
But sort within group, it reads the records of each group until it reach end of group or max core parameter limit , sort them with minor key and write to output port and repeat step for next group.

  Was this answer useful?  Yes


  • Sep 13th, 2020

When we use the already sorted data(based on field 1) to sort again with field 2 as you say, then the output will only be sorted with Field 2. In case of sort within groups, we will provide field 1 as major key and field 2 as minor key, which means this component will maintain the sorted order of the major key and within that major group, it will again sort the records based on minor key which is field 2. This way the output will be a sorted output based on both field1 & field 2.

  Was this answer useful?  Yes


  • Oct 4th, 2020

As it will re-sort the data on the y key given ignoring the existing sort order

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions