Sha256: 77400a53284b16fbd9bfa2bea33d40384a00d21cba4b43fcf296f126d8846a90

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 KB

Contents

.TH Image
.PP
Extend the left operand with a new relation\-valued attribute, image of the
tuple in the right relation.
.SH Signature
.PP
.RS
.nf
image(left: Relation, right: Relation, as: AttrName) -> Relation
.fi
.RE
.SH Examples
.PP
.RS
.nf
image(suppliers, supplies, :supplying)
.fi
.RE
.SH Description
.PP
This operator extends each tuple of the left operand, say \fB\fCt\fR, with a new
attribute called \fB\fCas\fR\&. The latter is a relation\-valued attribute, and is the
image of \fB\fCt\fR with respect to the right relation. The image is defined as a
restriction\-projection: restriction on tuples that match \fB\fCt\fR and projection
on all but common attributes between left and right.
.PP
In other words, this operator is a shortcut for the following longer
expression:
.PP
.RS
.nf
def image(left, right, as)
  extend(left, as => ->(t){
    allbut(
      matching(right, 
.BR Relation (t)),
      left.attr_list & right.attr_list)
  })
end
image(suppliers, supplies, :supplying)
.fi
.RE
.PP
Note that the image operator is such that every tuple of the left operand
appears in the result, including those whose image is empty on right. As
expected, an empty relation of correct relation type is used for those.
.SH Implementation notes
.PP
As of current Alf version, the current SQL compilation is not optimal and
partly relies on in\-memory operations. Please check the compilation plans.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-shell-0.16.4 doc/man/image.man
alf-shell-0.16.0 doc/man/image.man