mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
be831d09f7
* [WIP] * Update skip-list * Update ci_config.json * Do not sync inserts for test * Fix more tests * Fix another test * Enable one more test * More fixed tests * More test fixes * Do not absolutize server path for now * More test fixes * Unset CLICKHOUSE_LOG_COMMENT where necessary * Remove debugging set -e * Fix more tests * Fix test reference * Fix style check
69 lines
2.5 KiB
SQL
69 lines
2.5 KiB
SQL
SELECT '====array====';
|
|
DROP TABLE IF EXISTS t_arr;
|
|
CREATE TABLE t_arr (a Array(UInt32)) ENGINE = MergeTree ORDER BY tuple() SETTINGS min_bytes_for_wide_part = 0;
|
|
INSERT INTO t_arr VALUES ([1]) ([]) ([1, 2, 3]) ([1, 2]);
|
|
|
|
SYSTEM DROP MARK CACHE;
|
|
SELECT a.size0 FROM t_arr;
|
|
|
|
SYSTEM FLUSH LOGS;
|
|
SELECT ProfileEvents.Values[indexOf(ProfileEvents.Names, 'FileOpen')]
|
|
FROM system.query_log
|
|
WHERE (type = 'QueryFinish') AND (lower(query) LIKE lower('SELECT a.size0 FROM %t_arr%'))
|
|
AND event_time > now() - INTERVAL 10 SECOND AND current_database = currentDatabase();
|
|
|
|
SELECT '====tuple====';
|
|
DROP TABLE IF EXISTS t_tup;
|
|
CREATE TABLE t_tup (t Tuple(s String, u UInt32)) ENGINE = MergeTree ORDER BY tuple() SETTINGS min_bytes_for_wide_part = 0;
|
|
INSERT INTO t_tup VALUES (('foo', 1)) (('bar', 2)) (('baz', 42));
|
|
|
|
SYSTEM DROP MARK CACHE;
|
|
SELECT t.s FROM t_tup;
|
|
|
|
SYSTEM DROP MARK CACHE;
|
|
SELECT t.u FROM t_tup;
|
|
|
|
SYSTEM FLUSH LOGS;
|
|
SELECT ProfileEvents.Values[indexOf(ProfileEvents.Names, 'FileOpen')]
|
|
FROM system.query_log
|
|
WHERE (type = 'QueryFinish') AND (lower(query) LIKE lower('SELECT t._ FROM %t_tup%'))
|
|
AND event_time > now() - INTERVAL 10 SECOND AND current_database = currentDatabase();
|
|
|
|
SELECT '====nullable====';
|
|
DROP TABLE IF EXISTS t_nul;
|
|
CREATE TABLE t_nul (n Nullable(UInt32)) ENGINE = MergeTree ORDER BY tuple() SETTINGS min_bytes_for_wide_part = 0;
|
|
INSERT INTO t_nul VALUES (1) (NULL) (2) (NULL);
|
|
|
|
SYSTEM DROP MARK CACHE;
|
|
SELECT n.null FROM t_nul;
|
|
|
|
SYSTEM FLUSH LOGS;
|
|
SELECT ProfileEvents.Values[indexOf(ProfileEvents.Names, 'FileOpen')]
|
|
FROM system.query_log
|
|
WHERE (type = 'QueryFinish') AND (lower(query) LIKE lower('SELECT n.null FROM %t_nul%'))
|
|
AND event_time > now() - INTERVAL 10 SECOND AND current_database = currentDatabase();
|
|
|
|
SELECT '====map====';
|
|
SET allow_experimental_map_type = 1;
|
|
DROP TABLE IF EXISTS t_map;
|
|
CREATE TABLE t_map (m Map(String, UInt32)) ENGINE = MergeTree ORDER BY tuple() SETTINGS min_bytes_for_wide_part = 0;
|
|
INSERT INTO t_map VALUES (map('a', 1, 'b', 2)) (map('a', 3, 'c', 4)), (map('b', 5, 'c', 6));
|
|
|
|
--- will read 4 files: keys.bin, keys.mrk2, size0.bin, size0.mrk2
|
|
SYSTEM DROP MARK CACHE;
|
|
SELECT m.keys FROM t_map;
|
|
|
|
SYSTEM DROP MARK CACHE;
|
|
SELECT m.values FROM t_map;
|
|
|
|
SYSTEM FLUSH LOGS;
|
|
SELECT ProfileEvents.Values[indexOf(ProfileEvents.Names, 'FileOpen')]
|
|
FROM system.query_log
|
|
WHERE (type = 'QueryFinish') AND (lower(query) LIKE lower('SELECT m.% FROM %t_map%'))
|
|
AND event_time > now() - INTERVAL 10 SECOND AND current_database = currentDatabase();
|
|
|
|
DROP TABLE t_arr;
|
|
DROP TABLE t_nul;
|
|
DROP TABLE t_tup;
|
|
DROP TABLE t_map;
|