Skip to content

Commit 05941a8

Browse files
committed
improve test
1 parent 8dbc32e commit 05941a8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/queries/0_stateless/03801_autopr_input_bytes_estimation_query_with_subqueries.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ SET use_query_condition_cache=0;
1414
create table t(a UInt64) engine=MergeTree order by a;
1515
insert into t select number from numbers_mt(1e6);
1616

17-
SELECT a % 10000 FROM t FORMAT Null SETTINGS log_comment='query_0';
17+
SELECT a % 10000 FROM t FORMAT Null SETTINGS log_comment='03801_autopr_input_bytes_estimation_query_with_subqueries_query_0';
1818

1919
-- `CounterID` is part of the PK
20-
SELECT EventTime, CounterID, URL, Referer FROM test.hits WHERE CounterID IN (SELECT a % 10000 FROM t) FORMAT Null SETTINGS log_comment='query_1';
20+
SELECT EventTime, CounterID, URL, Referer FROM test.hits WHERE CounterID IN (SELECT a % 10000 FROM t) FORMAT Null SETTINGS log_comment='03801_autopr_input_bytes_estimation_query_with_subqueries_query_1';
2121
-- `WatchID` is not
22-
SELECT EventTime, CounterID, URL, Referer FROM test.hits WHERE WatchID IN (SELECT a % 10000 FROM t) FORMAT Null SETTINGS log_comment='query_1';
22+
SELECT EventTime, CounterID, URL, Referer FROM test.hits WHERE WatchID IN (SELECT a % 10000 FROM t) FORMAT Null SETTINGS log_comment='03801_autopr_input_bytes_estimation_query_with_subqueries_query_2';
2323

2424
SET enable_parallel_replicas=0, automatic_parallel_replicas_mode=0;
2525

@@ -33,7 +33,7 @@ WITH (
3333
SELECT
3434
ProfileEvents['ReadCompressedBytes']
3535
FROM system.query_log
36-
WHERE (event_date >= yesterday()) AND (event_time >= NOW() - INTERVAL '15 MINUTES') AND (current_database = currentDatabase()) AND (log_comment LIKE 'query_0') AND (type = 'QueryFinish')
36+
WHERE (event_date >= yesterday()) AND (event_time >= NOW() - INTERVAL '15 MINUTES') AND (current_database = currentDatabase()) AND (log_comment = '03801_autopr_input_bytes_estimation_query_with_subqueries_query_0') AND (type = 'QueryFinish')
3737
ORDER BY event_time_microseconds
3838
) AS compressed_bytes_subquery
3939
SELECT format('{} {} {}', log_comment, compressed_bytes, statistics_input_bytes)
@@ -43,7 +43,7 @@ FROM (
4343
ProfileEvents['ReadCompressedBytes'] - compressed_bytes_subquery AS compressed_bytes,
4444
ProfileEvents['RuntimeDataflowStatisticsInputBytes']::Int64 statistics_input_bytes
4545
FROM system.query_log
46-
WHERE (event_date >= yesterday()) AND (event_time >= NOW() - INTERVAL '15 MINUTES') AND (current_database = currentDatabase()) AND (log_comment LIKE 'query_1') AND (type = 'QueryFinish')
46+
WHERE (event_date >= yesterday()) AND (event_time >= NOW() - INTERVAL '15 MINUTES') AND (current_database = currentDatabase()) AND (match(log_comment, '03801_autopr_input_bytes_estimation_query_with_subqueries_query_[12]')) AND (type = 'QueryFinish')
4747
ORDER BY event_time_microseconds
4848
)
4949
WHERE greatest(compressed_bytes, statistics_input_bytes) / least(compressed_bytes, statistics_input_bytes) > 2;

0 commit comments

Comments
 (0)