Skip to content

Commit

Permalink
Merge branch 'multiway_join_rules' into disable-temp-store
Browse files Browse the repository at this point in the history
Conflicts:
	raco/algebra.py
	raco/compile.py
	raco/datalog/datalog_test.py
	raco/datalog/query_tests.py
	raco/myrial/interpreter.py
	raco/myrial/myrial_test.py
	raco/myrial/optimizer_tests.py
	raco/myrialang.py
	raco/operator_test.py
  • Loading branch information
dhalperi committed Jun 19, 2014
2 parents 72d7d12 + 6290692 commit 6a76d02
Show file tree
Hide file tree
Showing 40 changed files with 1,331 additions and 380 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Output languages include:
* The Myria physical algebra.
* A pseudocode algebra
* A Python algebra
* A C algebra
* A Grappa algebra
* A C++ algebra, C++ source code
* A Grappa algebra, Grappa source code

Users can of course author programs by directly instantiating one of the intermediate or output algebras as well as one of the source languages.

Expand Down
2 changes: 1 addition & 1 deletion c_test_environment/clang_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class ClangTest(unittest.TestCase, PlatformTest):
def check(self, query, name):
with Chdir("c_test_environment") as d:
emitCode(query, name, CCAlgebra)
emitCode(query, name, CCAlgebra())
checkquery(name, ClangRunner())

def setUp(self):
Expand Down
2 changes: 1 addition & 1 deletion dlogcompiletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def comment(s):
dlog.fromDatalog(query)
print dlog.logicalplan

dlog.optimize(target=MyriaAlgebra, eliminate_common_subexpressions=False)
dlog.optimize(target=MyriaAlgebra(), eliminate_common_subexpressions=False)

code = dlog.compile()
print code
Expand Down
2 changes: 1 addition & 1 deletion examples/example_queries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from raco.language import CCAlgebra, MyriaAlgebra, GrappaAlgebra
from raco.language import CCAlgebra, GrappaAlgebra
from emitcode import emitCode

import logging
Expand Down
2 changes: 1 addition & 1 deletion examples/grappa_test_query.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from raco import RACompiler
from raco.language import CCAlgebra, MyriaAlgebra, GrappaAlgebra
from raco.language import CCAlgebra, GrappaAlgebra
from raco.algebra import LogicalAlgebra

import logging
Expand Down
2 changes: 1 addition & 1 deletion examples/sp2bench/sp2bench_rdf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import test_query
from raco.language import CCAlgebra, MyriaAlgebra, GrappaAlgebra
from raco.language import CCAlgebra, GrappaAlgebra


tr = "sp2bench_1m"
Expand Down
2 changes: 1 addition & 1 deletion examples/sp2bench/sp2bench_rdf_long.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import raco.algebra as algebra
import raco.rules as rules
from raco.grappalang import GrappaSymmetricHashJoin, GrappaHashJoin
from raco.language import CCAlgebra, MyriaAlgebra, GrappaAlgebra
from raco.language import CCAlgebra, GrappaAlgebra


tr = "sp2bench_1m"
Expand Down
4 changes: 2 additions & 2 deletions expressiontest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def testRA():
R = raco.catalog.Relation("R", sch)
J = Join(EQ(e.UnnamedAttributeRef(0), e.NamedAttributeRef("x")), Scan(R), Scan(R))
A = Apply(J, z=e.PLUS(e.NamedAttributeRef("x"), e.NamedAttributeRef("y")), w=e.UnnamedAttributeRef(3))
exprs = optimize([('A',A)], target=MyriaAlgebra, source=LogicalAlgebra)
exprs = optimize([('A',A)], target=MyriaAlgebra(), source=LogicalAlgebra)
print exprs
print compile(exprs)

Expand All @@ -46,7 +46,7 @@ def testDatalog():

# Optimize the query, includes producing a physical plan
print "************ PHYSICAL PLAN *************"
dlog.optimize(target=MyriaAlgebra, eliminate_common_subexpressions=False)
dlog.optimize(target=MyriaAlgebra(), eliminate_common_subexpressions=False)
print dlog.physicalplan
print

Expand Down
2 changes: 0 additions & 2 deletions external_iterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import raco.scheme
from raco import algebra
from raco import myrialang
from raco.compile import optimize
from raco.language import MyriaAlgebra

import myria

Expand Down
2 changes: 1 addition & 1 deletion hellodatalogworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# expression to a target expression
#result = optimize(ra, target=PseudoCodeAlgebra, source=LogicalAlgebra)
#result = optimize(ra, target=ProtobufAlgebra, source=LogicalAlgebra)
result = optimize(ra, target=MyriaAlgebra, source=LogicalAlgebra)
result = optimize(ra, target=MyriaAlgebra(), source=LogicalAlgebra)

print result

Expand Down
2 changes: 1 addition & 1 deletion helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def comment(s):

# Optimize the query, includes producing a physical plan
print "************ PHYSICAL PLAN *************"
dlog.optimize(target=MyriaAlgebra, eliminate_common_subexpressions=False)
dlog.optimize(target=MyriaAlgebra(), eliminate_common_subexpressions=False)
print dlog.physicalplan
print

Expand Down
7 changes: 4 additions & 3 deletions raco/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from raco.datalog.grammar import parse
from raco.language import MyriaAlgebra
from raco.language import MyriaLeftDeepTreeAlgebra
from raco.algebra import LogicalAlgebra
from raco.compile import optimize

Expand All @@ -20,8 +20,9 @@ def fromDatalog(self, program):
LOG.debug("parser output: %s", self.parsed)
self.logicalplan = self.parsed.toRA()

def optimize(self, target=MyriaAlgebra,
eliminate_common_subexpressions=False):
def optimize(self, target=MyriaLeftDeepTreeAlgebra(),
eliminate_common_subexpressions=False,
environment_variables=None):
"""Convert logical plan to physical plan"""
self.target = target
self.physicalplan = optimize(
Expand Down

0 comments on commit 6a76d02

Please sign in to comment.