Skip to content

Commit

Permalink
Merge pull request #261 from uwescience/sql-lang
Browse files Browse the repository at this point in the history
Sql backend: basic, incomplete implementation and some tests
  • Loading branch information
dhalperi committed Jul 2, 2014
2 parents 79edbf2 + 3cf3dea commit 4f3d3f2
Show file tree
Hide file tree
Showing 46 changed files with 755 additions and 875 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
6 changes: 3 additions & 3 deletions examples/emitcode.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from raco import RACompiler
from raco.algebra import LogicalAlgebra
from raco.language.logical import LogicalAlgebra
from raco.compile import compile
import raco.viz as viz

Expand Down Expand Up @@ -28,7 +28,7 @@ def emitCode(query, name, algebra):
dlog.optimize(target=algebra, 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 @@ -38,7 +38,7 @@ def emitCode(query, name, algebra):
code = ""
code += comment("Query " + query)
code += compile(dlog.physicalplan)

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


Expand Down Expand Up @@ -48,7 +48,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 @@ -71,24 +71,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 @@ -105,7 +105,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 4f3d3f2

Please sign in to comment.