Allbut

Projects a subset of attributes away.

Signature

allbut(operand: Relation, attributes: AttrList) -> Relation

Examples

allbut(suppliers, [:city])

Description

Computes the relation obtained by removing a subset of attributes from operand tuples.

This operator is the inverse of project. While the latter keeps attributes, this one removes them. project actually supports an allbut variant, which is equivalent to this operator. In other words, this operator can be understood as follows:

def allbut(operand, attributes)
  project(operand, attributes, allbut: true)
end
allbut(suppliers, [:city, :status])

Implementation notes

Unlike SQL, this operator ALWAYS remove duplicates. There is no way, in Alf, to compute bags of tuples.