memgraph/tests/macro_benchmark/harness/groups/expression/common.py
Mislav Bradac 3e793fb8ac Add single_create group to harness
Reviewers: mferencevic, buda

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D714
2017-08-28 11:45:12 +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)