Sha256: 6512cf55102c541706fa15d8e8ef10d6ed5f9566613d2c964cb327654da11476
Contents?: true
Size: 1 KB
Versions: 5
Compression:
Stored size: 1 KB
Contents
# Summarize Aggregate and compute ## Signature summarize(operand: Relation, by: AttrList, aggs: Summarization) -> Relation ## Examples summarize(supplies, [:sid], total: sum(:qty)) summarize(supplies, [:sid], total: sum{|t| t.qty * 2 }) summarize(supplies, [:pid, :qty], {total: sum{|t| t.qty * 2 }}, allbut: true) ## Description Computes the relation obtained by taking the projection of `operand` on `by` attributes then extending each tuple `t` with the result of aggregations defined by `aggs` on the tuples from `operand` matching `t`. In SQL terms, `SELECT [by], [agg] FROM operand GROUP BY [by]`. ## Implementation notes As of current Alf version, this operator cannot be translated to SQL code. That means that all computations are done in ruby, which may seriously hurt performance. Similarly, as `summarize` tends to be a showstopper during compilation, it is strongly recommended to use it as high as possible in query expressions trees so as to delegate the largest possible query parts to data engines.
Version data entries
5 entries across 5 versions & 1 rubygems