transformations:aggregate
This is an old revision of the document!
Aggregate
This transformation calculates the aggregates for selected columns grouped by another set of columns.
Available aggregations:
- Sum
- Count
- Count only distinct values
- Average
- Min
- Max
EXAMPLE
Source table: The longest rivers in the world
River | Length(km) | Continent |
---|---|---|
Nile | 6650 | Africa |
Amazon | 6400 | South America |
Yangtze | 6300 | Asia |
Mississippi | 6275 | North America |
Yenisei | 5539 | Asia |
Yellow River | 5464 | Asia |
Ob | 5410 | Asia |
Paraná | 4880 | South America |
Objective: Find out the longest river on each continent.
Transformation parameters:
- Calculate: Length(km)
- Aggregation: Max
- Group by: Continent
Output table:
River | Continent | Max of Length(km) |
---|---|---|
Nile | Africa | 6650 |
Yangtze | Asia | 6300 |
Mississippi | North America | 6275 |
Amazon | South America | 6400 |
transformations/aggregate.1430484574.txt.gz · Last modified: 2015/05/01 08:49 by dmitry