<commit_before>from raco import RACompiler
from raco.language import MyriaAlgebra
from raco.algebra import LogicalAlgebra

# A simple join
query = """
A(x,z) :- R(x,y), S(y,z)
"""

def comment(s):
  print "/*\n%s\n*/" % str(s)

# Create a cmpiler object
dlog = RACompiler()

# parse the query
dlog.fromDatalog(query)
print dlog.logicalplan

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

# generate code in the target language
code = dlog.compile()
print code
<commit_msg>helloworld: make what it outputs obvious<commit_after>from raco import RACompiler
from raco.language import MyriaAlgebra
from raco.algebra import LogicalAlgebra

# A simple join
query = """
A(x,z) :- R(x,y), S(y,z)
"""

def comment(s):
  print "/*\n%s\n*/" % str(s)

# Create a cmpiler object
dlog = RACompiler()

# parse the query
dlog.fromDatalog(query)
print "************ LOGICAL PLAN *************"
print dlog.logicalplan
print

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

# generate code in the target language
code = dlog.compile()
print "************ CODE *************"
print code
print
{'fraction_non_alphanumeric': 0.1624405705229794, 'fraction_numerical': 0.0, 'mean_word_length': 5.647368421052631, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1144647', 'n_tokens_mistral': 433, 'n_tokens_neox': 437, 'n_words': 122}