Class: ArcFurnace::InnerJoin

Inherits:
AbstractJoin show all
Defined in:
lib/arc-furnace/inner_join.rb

Overview

Perform a join between a hash and a source, only producing rows from the source that match a row from the hash. The resulting row will merge the source “into” the hash, that is, values from the source that share the same keys will overwrite values in the hash value for the corresponding source row.

Example: Source row { id: “foo”, key1: “boo”, key2: “bar” } Matching hash row { id: “foo”, key1: “bar”, key3: “baz” } Result row: { id: “foo”, key1: “boo”, key2: “bar”, key3: “baz” }

Instance Attribute Summary

Attributes inherited from Node

#error_handler, #node_id, #params

Instance Method Summary collapse

Methods inherited from AbstractJoin

#initialize, #value

Methods inherited from Source

#close, #empty?, #finalize, #prepare, #row, #value

Constructor Details

This class inherits a constructor from ArcFurnace::AbstractJoin

Instance Method Details

#advanceObject



16
17
18
19
20
21
22
23
24
# File 'lib/arc-furnace/inner_join.rb', line 16

def advance
  loop do
    @value = source.row
    break if @value.nil?
    if merge_source_row(@value)
      break
    end
  end
end