Multiway join rules

Add rules to compile query to a plan using HyperCube shuffle and multiway join. 
* [x]  add rule to merge left deep join into nary join in logical plan
* [x]  add rule break nary join to hypercube shuffle and local multiway join
* [x]  add rule to instantiate local multiway join (currently we only have leapfrog, but there could be more, so this part is seperated from break break nary join)
* [x]  add rule to place sort before LeapFrogJoin.
* [x]  add unit test
* [x]  add query test
 

On Tuesday, June 17, 2014, Shumo Chu <notifications@github.com> wrote:

> In raco/algebra.py:
>
> > @@ -856,6 +1012,10 @@ def __init__(self, body=None):
> >      def children(self):
> >          return [self.body]
> >
> > +    def num_tuples(self):
> > +        # TODO:  what is the correct estimation?
>
> I think a default behavior is needed. num_tuples will be called if this
> operator is a descedent of NaryJoin. I will add a unified behavior for
> all the hard to define cardinality output operators. (e.g. assume the
> cardinalities of their outputs are equal if we have no idea. )
>


Estimate as best you can!

System R assumed for years that a join produced |R|*|S|*0.1


—
> Reply to this email directly or view it on GitHub
> <https://github.com/uwescience/raco/pull/201/files#r13891004>.
>