Fix 02784_parallel_replicas_automatic_decision_join

This commit is contained in:
Igor Nikonov 2024-07-15 12:03:12 +00:00
parent f7befaf68e
commit 261ff133b8
3 changed files with 10 additions and 11 deletions

View File

@ -6,7 +6,6 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CLICKHOUSE_CLIENT_TRACE=${CLICKHOUSE_CLIENT/"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"/"--send_logs_level=trace"}
function were_parallel_replicas_used () {
# Not using current_database = '$CLICKHOUSE_DATABASE' as nested parallel queries aren't run with it
$CLICKHOUSE_CLIENT --query "
SELECT
initial_query_id,

View File

@ -4,8 +4,8 @@
02784_automatic_parallel_replicas_join-default_simple_join_1M_pure 10 estimated parallel replicas
02784_automatic_parallel_replicas_join-default_simple_join_300k_pure 3 estimated parallel replicas
02784_automatic_parallel_replicas_join-default_simple_join_300k_pure 33 estimated parallel replicas
02784_automatic_parallel_replicas_join-default_simple_join_0_pure Distinct parallel subqueries: 2 Used parallel replicas: true
02784_automatic_parallel_replicas_join-default_simple_join_10M_pure Distinct parallel subqueries: 0 Used parallel replicas: false
02784_automatic_parallel_replicas_join-default_simple_join_5M_pure Distinct parallel subqueries: 1 Used parallel replicas: true
02784_automatic_parallel_replicas_join-default_simple_join_1M_pure Distinct parallel subqueries: 1 Used parallel replicas: true
02784_automatic_parallel_replicas_join-default_simple_join_300k_pure Distinct parallel subqueries: 2 Used parallel replicas: true
02784_automatic_parallel_replicas_join-default_simple_join_0_pure Used parallel replicas: true
02784_automatic_parallel_replicas_join-default_simple_join_10M_pure Used parallel replicas: false
02784_automatic_parallel_replicas_join-default_simple_join_5M_pure Used parallel replicas: true
02784_automatic_parallel_replicas_join-default_simple_join_1M_pure Used parallel replicas: true
02784_automatic_parallel_replicas_join-default_simple_join_300k_pure Used parallel replicas: true

View File

@ -9,17 +9,17 @@ CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
CLICKHOUSE_CLIENT_TRACE=${CLICKHOUSE_CLIENT/"--send_logs_level=${CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL}"/"--send_logs_level=trace"}
function were_parallel_replicas_used () {
# Not using current_database = '$CLICKHOUSE_DATABASE' as nested parallel queries aren't run with it
$CLICKHOUSE_CLIENT --query "
SELECT
initial_query_id,
concat('Distinct parallel subqueries: ' , countDistinctIf(query, initial_query_id != query_id)::String) as subqueries_parallelized,
concat('Used parallel replicas: ', (countIf(initial_query_id != query_id) != 0)::bool::String) as used
concat('Used parallel replicas: ', (ProfileEvents['ParallelReplicasUsedCount'] > 0)::bool::String) as used
FROM system.query_log
WHERE event_date >= yesterday()
AND initial_query_id LIKE '$1%'
GROUP BY initial_query_id
ORDER BY min(event_time_microseconds) ASC
AND query_id = initial_query_id
AND type = 'QueryFinish'
AND current_database = '$CLICKHOUSE_DATABASE'
ORDER BY event_time_microseconds ASC
FORMAT TSV"
}