Module: Axiom::Algebra::Join::Methods

Extended by:
Axiom::Aliasable
Defined in:
lib/axiom/algebra/join.rb

Instance Method Summary collapse

Methods included from Axiom::Aliasable

inheritable_alias

Instance Method Details

#join(other) {|relation| ... } ⇒ Join, Restriction

Return a relation that is the join of two relations

Examples:

natural join

join = relation.join(other)

theta-join using a block

join = relation.join(other) { |r| r.a.gte(r.b) }

Parameters:

  • other (Relation)

    the other relation to join

Yields:

  • (relation)

    optional block to restrict the tuples with

Yield Parameters:

  • relation (Relation)

    the context to evaluate the restriction with

Yield Returns:

  • (Function, #call)

    predicate to restrict the tuples with

Returns:



169
170
171
172
173
# File 'lib/axiom/algebra/join.rb', line 169

def join(other, &block)
  relation = Join.new(self, other)
  relation = relation.restrict(&block) if block
  relation
end