module Bud::PushSHOuterJoin

Public Instance Methods

invalidate_cache() click to toggle source
Calls superclass method
# File lib/bud/executor/join.rb, line 490
def invalidate_cache
  super
  # Only if need to check left join rel because outer joins in Bloom are
  # left outer joins.
  @missing_keys.clear if @rels.first.rescan
end
rescan_at_tick() click to toggle source
# File lib/bud/executor/join.rb, line 468
def rescan_at_tick
  true
end
stratum_end() click to toggle source
# File lib/bud/executor/join.rb, line 473
def stratum_end
  flush
  push_missing
end

Private Instance Methods

insert_item(item, offset) click to toggle source

XXX: duplicates code from PushSHJoin

# File lib/bud/executor/join.rb, line 447
def insert_item(item, offset)
  the_key = item.values_at(*@key_attnos[offset])

  #build
  # puts "building #{item.inspect} into @source[#{offset}] on key #{the_key.inspect}"
  if (@hash_tables[offset][the_key] ||= Set.new).add? item
    @found_delta = true
    #and probe
    # puts "probing #{item.inspect} into @source[#{1-offset}] on key #{the_key.inspect}"
    the_matches = @hash_tables[1-offset][the_key]
    if the_matches.nil? and offset == 0 # only doing Left Outer Join right now
      @missing_keys << the_key
    else
      # no longer missing no matter which side this tuple is
      @missing_keys.delete(the_key)
      process_matches(item, the_matches, offset) unless the_matches.nil?
    end
  end
end
push_missing() click to toggle source
# File lib/bud/executor/join.rb, line 479
def push_missing
  left_hash = @hash_tables[0]
  null_tuple = @rels[1].null_tuple
  @missing_keys.each do |key|
    left_hash[key].each do |t|
      push_out([t, null_tuple])
    end
  end
end