Sha256: ac7afc0aeee6872d80d846a9291d84b83dd69b4f1eab6f2111145132a6d723f3

Contents?: true

Size: 792 Bytes

Versions: 38

Compression:

Stored size: 792 Bytes

Contents

require 'arc-furnace/abstract_join'

module ArcFurnace
  # 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" }
  class InnerJoin < AbstractJoin

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

  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
arc-furnace-0.1.42 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.41 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.40 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.39 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.38 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.37 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.36 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.35 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.34 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.33 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.32 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.31 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.30 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.29 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.28 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.27 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.26 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.25 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.24 lib/arc-furnace/inner_join.rb
arc-furnace-0.1.23 lib/arc-furnace/inner_join.rb