Sha256: b21453b535fa847f2a7ada9d37806bf027456658cf2ac8cffd1a14fe84d0f541

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

.TH Summarize
.PP
Aggregate and compute
.SH Signature
.PP
.RS
.nf
summarize(operand: Relation, by: AttrList, aggs: Summarization) \-> Relation
.fi
.RE
.SH Examples
.PP
.RS
.nf
summarize(supplies, [:sid], total: sum(:qty))
.fi
.RE
.PP
.RS
.nf
summarize(supplies, [:sid], total: sum{|t| t.qty * 2 })
.fi
.RE
.PP
.RS
.nf
summarize(supplies, [:pid, :qty], {total: sum{|t| t.qty * 2 }}, allbut: true)
.fi
.RE
.SH Description
.PP
Computes the relation obtained by taking the projection of \fB\fCoperand\fR
on \fB\fCby\fR attributes then extending each tuple \fB\fCt\fR with the result of
aggregations defined by \fB\fCaggs\fR on the tuples from \fB\fCoperand\fR matching \fB\fCt\fR\&.
.PP
In SQL terms, \fB\fCSELECT [by], [agg] FROM operand GROUP BY [by]\fR\&.
.SH Implementation notes
.PP
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.
.PP
Similarly, as \fB\fCsummarize\fR 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

3 entries across 3 versions & 1 rubygems

Version Path
alf-shell-0.16.3 doc/man/summarize.man
alf-shell-0.16.2 doc/man/summarize.man
alf-shell-0.16.1 doc/man/summarize.man