mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
add test
This commit is contained in:
parent
b05d3ed6df
commit
bd71442ea2
@ -0,0 +1,2 @@
|
||||
1
|
||||
1
|
96
tests/queries/0_stateless/03270_processors_profile_log_3.sh
Executable file
96
tests/queries/0_stateless/03270_processors_profile_log_3.sh
Executable file
@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CUR_DIR"/../shell_config.sh
|
||||
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "
|
||||
CREATE TABLE t
|
||||
(
|
||||
a UInt32,
|
||||
b UInt32
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY (a, b);
|
||||
|
||||
INSERT INTO t SELECT number, number FROM numbers(1000);
|
||||
"
|
||||
|
||||
query_id="03270_processors_profile_log_3_$RANDOM"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query_id="$query_id" -q "
|
||||
SET log_processors_profiles = 1;
|
||||
|
||||
WITH
|
||||
t0 AS
|
||||
(
|
||||
SELECT *
|
||||
FROM numbers(1000)
|
||||
),
|
||||
t1 AS
|
||||
(
|
||||
SELECT number * 3 AS b
|
||||
FROM t0
|
||||
)
|
||||
SELECT b * 3
|
||||
FROM t
|
||||
WHERE a IN (t1)
|
||||
FORMAT Null;
|
||||
"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query_id="$query_id" -q "
|
||||
SYSTEM FLUSH LOGS;
|
||||
|
||||
SELECT sum(elapsed_us) > 0
|
||||
FROM system.processors_profile_log
|
||||
WHERE event_date >= yesterday() AND query_id = '$query_id' AND name = 'CreatingSetsTransform';
|
||||
"
|
||||
|
||||
#####################################################################
|
||||
|
||||
$CLICKHOUSE_CLIENT -q "
|
||||
CREATE TABLE t1
|
||||
(
|
||||
st FixedString(54)
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY tuple();
|
||||
|
||||
INSERT INTO t1 VALUES
|
||||
('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRTUVWXYZ'),
|
||||
('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'),
|
||||
('IIIIIIIIII\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0');
|
||||
"
|
||||
|
||||
query_id="03270_processors_profile_log_3_$RANDOM"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query_id="$query_id" -q "
|
||||
SET log_processors_profiles = 1;
|
||||
SET max_threads=2; -- no merging when max_threads=1
|
||||
|
||||
WITH
|
||||
(
|
||||
SELECT groupConcat(',')(st)
|
||||
FROM t1
|
||||
ORDER BY ALL
|
||||
) AS a,
|
||||
(
|
||||
SELECT groupConcat(',')(CAST(st, 'String'))
|
||||
FROM t1
|
||||
ORDER BY ALL
|
||||
) AS b
|
||||
SELECT a = b
|
||||
FORMAT Null;
|
||||
"
|
||||
|
||||
$CLICKHOUSE_CLIENT --query_id="$query_id" -q "
|
||||
SYSTEM FLUSH LOGS;
|
||||
|
||||
SELECT sum(elapsed_us) > 0
|
||||
FROM system.processors_profile_log
|
||||
WHERE event_date >= yesterday() AND query_id = '$query_id' AND name = 'MergingSortedTransform';
|
||||
"
|
||||
|
Loading…
Reference in New Issue
Block a user