Skip to content

Commit

Permalink
Merge pull request #378 from cwida/expressionstate
Browse files Browse the repository at this point in the history
Rework ExpressionExecutor
  • Loading branch information
Mytherin committed Dec 22, 2019
2 parents 8cf352b + 5842d23 commit 4177ad5
Show file tree
Hide file tree
Showing 155 changed files with 4,636 additions and 2,750 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ matrix:
script:
- mkdir -p build/debug
- (cd build/debug && cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZER=FALSE ../.. && cmake --build .)
- valgrind ./build/debug/test/unittest -s "[tpch]"
- valgrind ./build/debug/test/unittest -s "Test TPC-H SF0.01"


- os: linux
Expand Down Expand Up @@ -179,7 +179,7 @@ matrix:
- build/coverage/test/unittest

after_success:
- coveralls -b build/coverage -E '.*CMakeCXXCompilerId.cpp' --exclude tools --exclude benchmark --exclude examples --exclude third_party --exclude test --exclude src/common/enums --exclude src/parser/transform/helpers/nodetype_to_string.cpp --gcov-options '\-lp'
- coveralls -b build/coverage -E '.*CMakeCXXCompilerId.cpp' --exclude tools --exclude benchmark --exclude examples --exclude third_party --exclude test --exclude src/common/enums --exclude src/parser/transform/helpers/nodetype_to_string.cpp --exclude build/coverage/third_party/libpg_query/grammar --gcov-options '\-lp'


- os: linux
Expand Down
1 change: 1 addition & 0 deletions benchmark/run_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def pull_new_changes():

def build_optimized():
log("Starting optimized build")
os.system('rm -rf build')
proc = subprocess.Popen(['make', 'opt', 'imdb','-j'], stdout=FNULL, stderr=subprocess.PIPE)
proc.wait()
if proc.returncode != 0:
Expand Down
2 changes: 2 additions & 0 deletions scripts/generate_csv_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def create_csv_header(csv_dir):

tpch_dir = 'third_party/dbgen'
tpch_queries = os.path.join(tpch_dir, 'queries')
tpch_answers_sf001 = os.path.join(tpch_dir, 'answers', 'sf0.01')
tpch_answers_sf01 = os.path.join(tpch_dir, 'answers', 'sf0.1')
tpch_answers_sf1 = os.path.join(tpch_dir, 'answers', 'sf1')
tpch_header = os.path.join(tpch_dir, 'include', 'tpch_constants.hpp')
Expand All @@ -73,6 +74,7 @@ def create_tpch_header(tpch_dir):
"""
# write the queries
result += write_dir(tpch_queries, "TPCH_QUERIES")
result += write_dir(tpch_answers_sf001, "TPCH_ANSWERS_SF0_01")
result += write_dir(tpch_answers_sf01, "TPCH_ANSWERS_SF0_1")
result += write_dir(tpch_answers_sf1, "TPCH_ANSWERS_SF1")

Expand Down
25 changes: 16 additions & 9 deletions scripts/generate_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,20 @@ def strip_p(x):

# now perform a series of replacements in the file to construct the final yacc file

def get_file_contents(fpath, add_line_numbers=False):
with open(fpath, 'r') as f:
result = f.read()
if add_line_numbers:
return '#line 1 "%s"\n' % (fpath,) + result
else:
return result


# grammar.hpp
with open(header_file, 'r') as f:
text = text.replace("{{{ GRAMMAR_HEADER }}}", f.read())
text = text.replace("{{{ GRAMMAR_HEADER }}}", get_file_contents(header_file, True))

# grammar.cpp
with open(source_file, 'r') as f:
text = text.replace("{{{ GRAMMAR_SOURCE }}}", f.read())
text = text.replace("{{{ GRAMMAR_SOURCE }}}", get_file_contents(source_file, True))

# keyword list
kw_token_list = "%token <keyword> " + " ".join([x[0] for x in kwlist])
Expand All @@ -111,7 +119,7 @@ def strip_p(x):
text = text.replace("{{{ KEYWORD_DEFINITIONS }}}", kw_definitions)

# types
def concat_dir(dname, extension):
def concat_dir(dname, extension, add_line_numbers=False):
result = ""
for fname in os.listdir(dname):
fpath = os.path.join(dname, fname)
Expand All @@ -120,8 +128,7 @@ def concat_dir(dname, extension):
else:
if not fname.endswith(extension):
continue
with open(fpath, 'r') as f:
result += f.read() + "\n"
result += get_file_contents(fpath, add_line_numbers)
return result

type_definitions = concat_dir(type_dir, ".yh")
Expand All @@ -132,7 +139,7 @@ def concat_dir(dname, extension):
text = text.replace("{{{ TYPES }}}", type_definitions)

# grammar rules
grammar_rules = concat_dir(rule_dir, ".y")
grammar_rules = concat_dir(rule_dir, ".y", True)

text = text.replace("{{{ GRAMMAR RULES }}}", grammar_rules)

Expand All @@ -150,4 +157,4 @@ def concat_dir(dname, extension):
exit(1)

os.rename(result_source, target_source_loc)
os.rename(result_header, target_header_loc)
os.rename(result_header, target_header_loc)
Loading

0 comments on commit 4177ad5

Please sign in to comment.