Group and sort
This topic describes how to use the group and sort operator and its considerations.
Purpose
The group and sort operator groups data by specified fields, sorts the data within each group in a specified order, and outputs the sorted data.
Scenarios
Compute Link | Compute engine | Support |
Offline | MaxCompute | Yes |
Hive | Yes | |
HiveStorage | Yes | |
RDS/MySQL | No |
Instructions
Input node
The columns from the source data to be sorted.
Group and sort
You can select the grouping fields, the fields to sort by within each group, and the sort order. These fields become the output columns for the node.
Example: A product is grouped by region and sorted by sales volume. The result is shown in the following figure.

Only the top-ranked data in each group is retained.
Example: A product is grouped by region and sorted by sales volume. When configured to keep only the top-ranked record, the result is shown in the following figure.
