Sha256: 2beeba11907236b4fd4c7864ec1d8debc6f01cb5b05efc78cf80e1efb6972418

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

.TH Group
.PP
Relation\-valued attribute
.SH Signature
.PP
.RS
.nf
group(operand: Relation, attributes: AttrList, as: AttrName) \-> Relation
.fi
.RE
.SH Examples
.PP
.RS
.nf
group(suppliers, [:sid, :name, :status], :suppliers)
.fi
.RE
.PP
.RS
.nf
group(suppliers, [:city], :suppliers, allbut: true)
.fi
.RE
.SH Description
.PP
Summarizes \fB\fCoperand\fR by all but the specified \fB\fCattributes\fR and groups the
latter under a relation\-value attribute \fB\fCas\fR\&.
.PP
This operator could be formally defined as the following shortcut:
.PP
.RS
.nf
def group(operand, attributes, as)
  extend(
    allbut(operand, attributes),
    as: \->(t){ project(matching(operand, 
.BR Relation (t)), 
attributes) })
end
group(suppliers, [:sid, :name, :status], :suppliers)
.fi
.RE
.PP
This operators supports an ALL BUT variant, through the \fB\fCallbut\fR option.
When set to true, the operator keeps specified attributes and groups all
remaining ones as a relation\-valued attribute.
.SH Implementation notes
.PP
This operator does not compile to SQL so far. Contributions are welcome
to provide it with a SQL compilation for SQL DBMSs that support this kind
of feature (e.g. PostgreSQL with JSON data type)

Version data entries

3 entries across 3 versions & 1 rubygems

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