Class: LeftOuterJoin

Inherits:
Join
  • Object
show all
Defined in:
lib/streaming_join/left_outer_join.rb

Instance Method Summary collapse

Methods inherited from Join

#initialize, #null_left, #output, #process_stream, #report

Constructor Details

This class inherits a constructor from Join

Instance Method Details

#null_right(key, left) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/streaming_join/left_outer_join.rb', line 4

def null_right key, left
  o = "#{key}#{@sep_out}"

  left.each do |l|
    if @cols_r > 0
      o << "#{l}#{@sep_out}#{Array.new(@cols_r).join(@sep_out)}"
    else
      o = "#{key}#{@sep_out}#{l}"
    end
  end

  block_given? ? (yield o) : (puts o)
end