bloom-lang / bud

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

Outer join bug w/ multiple preds #315

Closed neilconway closed 11 years ago

neilconway commented 11 years ago

Test case w/ expected output:

class TestOuterJoinMultiplePreds
  include Bud

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

  bloom do
    t3 <= (t1 * t2).outer(:key => :key, :val => :val) {|x,y| x}
  end
end

class TestOuterJoinMultiPreds < MiniTest::Unit::TestCase
  def test_oj_multi
    i = TestOuterJoinMultiplePreds.new
    i.t1 <+ [[5, 10]]
    i.t2 <+ [[5, 11]]
    i.tick

    assert_equal([[5, 10]], i.t3.to_a.sort)
  end
end

Observed output:

  1) Failure:
TestOuterJoinMultiPreds#test_oj_multi [tc_joins.rb:839]:
Expected: [[5, 10]]
  Actual: []