memgraph/tests/macro_benchmark/groups/expression/common.py
Mislav Bradac b98c12ea89 Clean up of benchmark requirements file
Reviewers: mferencevic

Reviewed By: mferencevic

Differential Revision: https://phabricator.memgraph.io/D600
2017-07-29 18:26:18 +02:00

14 lines
330 B
Python

def generate(expressions, repetitions):
idx = 0
def get_alias():
nonlocal idx
idx += 1
return "a" + str(idx)
query = []
for i in range(repetitions):
for expression in expressions:
query.append(expression + " as " + get_alias())
return "RETURN " + ", ".join(query)