Skip to content

Commit

Permalink
Merge branch 'master' into bmyerz-merge-shuffle-groupby
Browse files Browse the repository at this point in the history
Conflicts:
	examples/emitcode.py
	examples/sp2bench/sp2bench_rdf_long.py
  • Loading branch information
dhalperi committed Jul 2, 2014
2 parents a9b7ce1 + 4f3d3f2 commit 3b67259
Show file tree
Hide file tree
Showing 46 changed files with 758 additions and 880 deletions.
4 changes: 2 additions & 2 deletions c++/scan_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import raco.algebra as alg
import raco.clang as clang
import raco.language.clang as clang
import raco.boolean as rbool


Expand Down Expand Up @@ -311,7 +311,7 @@ def visit (self,n):

#generate code for a join chain
elif isinstance(n,alg.NaryOperator) :
if isinstance(n,clang.FilteringNLJoinChain) :
if isinstance(n, clang.FilteringNLJoinChain) :
for arg in n.args :
self.visit(arg)
self.generate_join_chain(n)
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 @@ -3,7 +3,7 @@
from testquery import ClangRunner
from generate_test_relations import generate_default
from generate_test_relations import need_generate
from raco.language import CCAlgebra
from raco.language.clang import CCAlgebra
from platform_tests import PlatformTest

import sys
Expand Down
2 changes: 1 addition & 1 deletion c_test_environment/grappalang_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from testquery import GrappalangRunner
from generate_test_relations import generate_default
from generate_test_relations import need_generate
from raco.language import GrappaAlgebra
from raco.language.grappalang import GrappaAlgebra
from platform_tests import PlatformTest
from nose.plugins.skip import SkipTest

Expand Down
12 changes: 5 additions & 7 deletions examples/emitcode.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from raco import RACompiler
from raco.algebra import LogicalAlgebra
import raco.algebra as algebra
from raco.compile import compile
from raco.grappalang import GrappaShuffleHashJoin, GrappaSymmetricHashJoin, GrappaHashJoin
import raco.rules as rules
from raco.language.grappalang import (GrappaShuffleHashJoin,
GrappaSymmetricHashJoin)
import raco.viz as viz

import logging
Expand All @@ -19,7 +17,7 @@ def hack_plan(alg, plan):
alg.set_join_type(GrappaSymmetricHashJoin)
elif plan == "shuf":
alg.set_join_type(GrappaShuffleHashJoin)

def emitCode(query, name, algType, plan=""):
alg = algType()
hack_plan(alg, plan)
Expand All @@ -42,7 +40,7 @@ def emitCode(query, name, algType, plan=""):
dlog.optimize(target=alg, eliminate_common_subexpressions=False)

LOG.info("physical: %s",dlog.physicalplan)

print dlog.physicalplan
physical_dot = viz.operator_to_dot(dlog.physicalplan)
with open("%s.physical.dot"%(name), 'w') as dwf:
Expand All @@ -52,7 +50,7 @@ def emitCode(query, name, algType, plan=""):
code = ""
code += comment("Query " + query)
code += compile(dlog.physicalplan)

fname = name+'.cpp'
with open(fname, 'w') as f:
f.write(code)
Expand Down
24 changes: 12 additions & 12 deletions examples/sp2bench/sp2bench_rdf_long.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from emitcode import emitCode
import raco.algebra as algebra
from raco.language import CCAlgebra, GrappaAlgebra
from raco.language.grappalang import GrappaAlgebra
from raco.language.clang import CCAlgebra

import logging
logging.basicConfig(level=logging.DEBUG)
Expand Down Expand Up @@ -49,7 +49,7 @@
# TODO be sure DISTINCT


# syntactically join with equality;
# syntactically join with equality;
#queries['Q5a'] = """A(person, name) :- %(tr)s(article, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://localhost/vocabulary/bench/Article'),
queries['Q5a'] = """A(person, name) :- %(tr)s(article, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://localhost/vocabulary/bench/Article'),
%(tr)s(article, 'http://purl.org/dc/elements/1.1/creator', person),
Expand All @@ -72,24 +72,24 @@
# TODO: Q7 requires double negation


#TODO: enable Q8, after dealing with HashJoin( $0 != $7 ) type of cases
#queries['Q8'] = """Erdoes(erdoes) :- %(tr)s(erdoes, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://xmlns.com/foaf/0.1/Person'),
_ = """Erdoes(erdoes) :- %(tr)s(erdoes, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://xmlns.com/foaf/0.1/Person'),
%(tr)s(erdoes, 'http://xmlns.com/foaf/0.1/name', "Paul Erdoes")
#TODO: enable Q8, after dealing with HashJoin( $0 != $7 ) type of cases
#queries['Q8'] = """Erdoes(erdoes) :- %(tr)s(erdoes, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://xmlns.com/foaf/0.1/Person'),
_ = """Erdoes(erdoes) :- %(tr)s(erdoes, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://xmlns.com/foaf/0.1/Person'),
%(tr)s(erdoes, 'http://xmlns.com/foaf/0.1/name', "Paul Erdoes")
A(name) :- Erdoes(erdoes),
%(tr)s(doc, 'http://purl.org/dc/elements/1.1/creator', erdoes),
%(tr)s(doc, 'http://purl.org/dc/elements/1.1/creator', author),
%(tr)s(doc2, 'http://purl.org/dc/elements/1.1/creator', author),
%(tr)s(doc2, 'http://purl.org/dc/elements/1.1/creator', author2),
%(tr)s(author2, 'http://xmlns.com/foaf/0.1/name', name),
author != erdoes,
doc2 != doc,
author != erdoes,
doc2 != doc,
author2 != erdoes,
author2 != author
A(name) :- Erdoes(erdoes),
%(tr)s(doc, 'http://purl.org/dc/elements/1.1/creator', erdoes),
%(tr)s(doc, 'http://purl.org/dc/elements/1.1/creator', author),
%(tr)s(doc, 'http://purl.org/dc/elements/1.1/creator', author),
%(tr)s(author, 'http://xmlns.com/foaf/0.1/name', name),
author != erdoes"""
#TODO be sure DISTINCT
Expand All @@ -106,7 +106,7 @@

queries['Q11'] = """A(ee) :- %(tr)s(publication, 'http://www.w3.org/2000/01/rdf-schema#seeAlso', ee)"""
#TODO order by, limit, offset

alg = CCAlgebra
prefix=""
import sys
Expand Down
60 changes: 0 additions & 60 deletions expressiontest.py

This file was deleted.

Loading

0 comments on commit 3b67259

Please sign in to comment.