From d676e2f5c59375edd9d0020572307bb62f41b938 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 21 Nov 2020 13:51:34 +0300 Subject: [PATCH] Pass settings for perf tests via protocol over SET query Thus they will be applied on reconnects, since clickhouse-driver may implicitly do it if the connection has been failed. --- docker/test/performance-comparison/perf.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docker/test/performance-comparison/perf.py b/docker/test/performance-comparison/perf.py index 46c37aebe4d..2568f7ac066 100755 --- a/docker/test/performance-comparison/perf.py +++ b/docker/test/performance-comparison/perf.py @@ -173,12 +173,9 @@ reportStageEnd('drop-1') settings = root.findall('settings/*') for conn_index, c in enumerate(all_connections): for s in settings: - try: - q = f"set {s.tag} = '{s.text}'" - c.execute(q) - print(f'set\t{conn_index}\t{c.last_query.elapsed}\t{tsv_escape(q)}') - except: - print(traceback.format_exc(), file=sys.stderr) + # requires clickhouse-driver >= 1.1.5 to accept arbitrary new settings + # (https://github.com/mymarilyn/clickhouse-driver/pull/142) + c.settings[s.tag] = s.text reportStageEnd('settings')