Aggregators

A module with classes for aggregation. An Aggregator has two methods: process and finish.

process(group, val) is called to “add” val to the aggregation of the set of values identified by the value of group. The value in group (which could be any hashable type, also a tuple as (‘A’, ‘B’)) thus corresponds to the GROUP BY attributes in SQL.

finish(group, default) is called to get the final result for group. If no such results exists, default is returned.

class pygrametl.aggregators.Aggregator

Bases: builtins.object

finish(group, default=None)
process(group, val)
class pygrametl.aggregators.SimpleAggregator

Bases: pygrametl.aggregators.Aggregator

finish(group, default=None)
process(group, val)
class pygrametl.aggregators.Sum

Bases: pygrametl.aggregators.SimpleAggregator

process(group, val)
class pygrametl.aggregators.Count

Bases: pygrametl.aggregators.SimpleAggregator

process(group, val)
class pygrametl.aggregators.CountDistinct

Bases: pygrametl.aggregators.SimpleAggregator

finish(group, default=None)
process(group, val)
class pygrametl.aggregators.Max

Bases: pygrametl.aggregators.SimpleAggregator

process(group, val)
class pygrametl.aggregators.Min

Bases: pygrametl.aggregators.SimpleAggregator

process(group, val)
class pygrametl.aggregators.Avg

Bases: pygrametl.aggregators.Aggregator

finish(group, default=None)
process(group, val)

Previous topic

Jythonmultiprocessing

Next topic

Steps

This Page