Skip to content

Commit

Permalink
raco: add test for bug #240
Browse files Browse the repository at this point in the history
also remove stray print statements in the tests.
  • Loading branch information
dhalperi committed Jun 12, 2014
1 parent bfdd2ba commit 040c08d
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions raco/myrial/optimizer_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ def test_shuffle_before_distinct(self):
"""

pp = self.get_physical_plan(query)
print str(pp)
self.assertEquals(self.get_count(pp, Distinct), 1)
for op in pp.walk():
if isinstance(op, Distinct):
Expand All @@ -368,11 +367,29 @@ def test_shuffle_before_difference(self):
"""

pp = self.get_physical_plan(query)
print str(pp)
self.assertEquals(self.get_count(pp, Difference), 1)
for op in pp.walk():
if isinstance(op, Difference):
self.assertIsInstance(op.left, MyriaShuffleConsumer)
self.assertIsInstance(op.left.input, MyriaShuffleProducer)
self.assertIsInstance(op.right, MyriaShuffleConsumer)
self.assertIsInstance(op.right.input, MyriaShuffleProducer)

def test_bug_240_broken_remove_unused_columns_rule(self):
query = """
particles = empty(nowGroup:int, timestep:int, grp:int);
haloTable1 = [from particles as P
emit P.nowGroup,
(P.timestep+P.grp) as halo,
count(*) as totalParticleCount];
haloTable2 = [from haloTable1 as H, particles as P
where H.nowGroup = P.nowGroup
emit *];
store(haloTable2, OutputTemp);
"""

# This is it -- just test that we can get the physical plan and
# compile to JSON. See https://github.com/uwescience/raco/issues/240
pp = self.execute_query(query, output='OutputTemp')

0 comments on commit 040c08d

Please sign in to comment.