Ungroup

Inverse of group

Signature

ungroup(operand: Relation, rva: AttrName) -> Relation

Examples

ungroup(group(suppliers, [:city], :suppliers, allbut: true), :suppliers)

Description

Computes the relation obtained by ungrouping a relation-valued attribute rva. Ungrouping rva leads as many tuples as in rva, each extended with the other attributes of operand.

rva must be a relation-valued attribute. It should not itself contain any attribute whose name clashes with an attribute of operand.

Implementation notes

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)