Sha256: bc0de5c80464e2e8207492549e40f0c9c15337e0c2d4b9fea0f10a918b13c6a6

Contents?: true

Size: 853 Bytes

Versions: 5

Compression:

Stored size: 853 Bytes

Contents

# Extend

Extends input tuples with derived/computed attributes

## Signature

extend(operand: Relation, ext: TupleComputation) -> Relation

## Examples

extend(suppliers,
  big:   ->(t){ t.name.upcase },
  small: ->(t){ t.name.downcase })

## Description

Computes a relation which is the same as `operand`, except that each of
its tuples has new attributes whose value is the result of evaluating the
tuple expressions specified in `ext`.

## Implementation notes

As of current Alf version, this operator cannot be translated to SQL code.
In other words, all computations are done in ruby, which may seriously
hurt performance.

Similarly, as `extend` 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

5 entries across 5 versions & 1 rubygems

Version Path
alf-shell-0.16.4 doc/txt/extend.txt
alf-shell-0.16.3 doc/txt/extend.txt
alf-shell-0.16.2 doc/txt/extend.txt
alf-shell-0.16.1 doc/txt/extend.txt
alf-shell-0.16.0 doc/txt/extend.txt