memgraph/tests/macro_benchmark/groups/expression/common.py
Mislav Bradac 7e5dddecae Move harness stuff to parent directory
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D799
2017-09-15 14:05:26 +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)