From 44e42052b184834466970a7d95a3943eba572dec Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 27 Jan 2024 13:12:21 +0100 Subject: [PATCH] Fix perf tests after sumMap starts to filter out -0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before perf tests was relying on the following: SELECT sumMap(['foo', 'bar'], [-0., -0.]) ┌─sumMap(['foo', 'bar'], [-0., -0.])─┐ │ (['bar','foo'],[-0,-0]) │ └────────────────────────────────────┘ While it got changed, and now: ┌─sumMap(['foo', 'bar'], [-0., -0.])─┐ │ ([],[]) │ └────────────────────────────────────┘ But it works for nan: SELECT sumMap(['foo', 'bar'], [nan, nan]) ┌─sumMap(['foo', 'bar'], [nan, nan])─┐ │ (['bar','foo'],[nan,nan]) │ └────────────────────────────────────┘ Signed-off-by: Azat Khuzhin --- tests/performance/scripts/compare.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/performance/scripts/compare.sh b/tests/performance/scripts/compare.sh index 7dc522dca7a..92ba383f965 100755 --- a/tests/performance/scripts/compare.sh +++ b/tests/performance/scripts/compare.sh @@ -444,10 +444,10 @@ create view query_logs as create table query_run_metric_arrays engine File(TSV, 'analyze/query-run-metric-arrays.tsv') as with ( - -- sumMapState with the list of all keys with '-0.' values. Negative zero is because - -- sumMap removes keys with positive zeros. + -- sumMapState with the list of all keys with 'nan' values. 'nan' is because + -- sumMap removes keys with positive/negative zeros. with (select groupUniqArrayArray(mapKeys(ProfileEvents)) from query_logs) as all_names - select arrayReduce('sumMapState', [(all_names, arrayMap(x->-0., all_names))]) + select arrayReduce('sumMapState', [(all_names, arrayMap(x->nan, all_names))]) ) as all_metrics select test, query_index, version, query_id, (finalizeAggregation( @@ -460,13 +460,13 @@ create table query_run_metric_arrays engine File(TSV, 'analyze/query-run-metric- ), arrayReduce('sumMapState', [( ['client_time', 'server_time', 'memory_usage'], - arrayMap(x->if(x != 0., x, -0.), [ + arrayMap(x->if(x != 0., x, nan), [ toFloat64(query_runs.time), toFloat64(query_duration_ms / 1000.), toFloat64(memory_usage)]))]) ] )) as metrics_tuple).1 metric_names, - metrics_tuple.2 metric_values + arrayMap(x->if(isNaN(x),0,x), metrics_tuple.2) metric_values from query_logs right join query_runs on query_logs.query_id = query_runs.query_id