bloom-lang / bud

Prototype Bud runtime (Bloom Under Development)
http://bloom-lang.net
Other
854 stars 59 forks source link

Incorrect outer join output #279

Closed neilconway closed 12 years ago

neilconway commented 12 years ago

The rescan logic for outer joins appears to be faulty:

require "rubygems"
require "bud"

class OjTc
  include Bud

  state do
    table :t1
    table :t2
    scratch :s1
  end

  bloom do
    s1 <= (t1 * t2).outer(:key => :key) {|x, y| y == [nil,nil] ? [x.key + 1, x.val + 1] : [x.key, x.val]}
  end
end

i = OjTc.new
i.t1 <+ [[5, 10]]
i.tick
i.t2 <+ [[5, 11]]
i.tick
puts i.s1.to_a.inspect

Expected output:

[[5, 10]]

Observed output:

[[6, 11], [5, 10]]
sriram-srinivasan commented 12 years ago

This works for me as expected, as of commit 49c472bf93…

sriram-srinivasan commented 12 years ago

Oops. Of course it does! I didn't see your earlier commit about the fix.