Class: FullOuterJoin

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

Instance Method Summary collapse

Methods inherited from Join

#initialize, #output, #process_stream, #report

Constructor Details

This class inherits a constructor from Join

Instance Method Details

#null_left(key, right) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/streaming_join/full_outer_join.rb', line 18

def null_left key, right
  o = "#{key}#{@sep_out}"

  if @cols_l > 0
    o << "#{Array.new(@cols_l).join(@sep_out)}#{@sep_out}#{right}"
  else
    o = "#{key}#{@sep_out}#{right}"
  end

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

#null_right(key, left) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/streaming_join/full_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