Fix bad test (tabs)

This commit is contained in:
Alexey Milovidov 2021-05-06 01:03:27 +03:00
parent 1ec7a1f0ca
commit 6959057393

View File

@ -27,139 +27,139 @@ CREATE TABLE codecTest (
-- checking for overflow -- checking for overflow
INSERT INTO codecTest (key, ref_valueU64, valueU64, ref_valueI64, valueI64) INSERT INTO codecTest (key, ref_valueU64, valueU64, ref_valueI64, valueI64)
VALUES (1, 18446744073709551615, 18446744073709551615, 9223372036854775807, 9223372036854775807), (2, 0, 0, -9223372036854775808, -9223372036854775808), (3, 18446744073709551615, 18446744073709551615, 9223372036854775807, 9223372036854775807); VALUES (1, 18446744073709551615, 18446744073709551615, 9223372036854775807, 9223372036854775807), (2, 0, 0, -9223372036854775808, -9223372036854775808), (3, 18446744073709551615, 18446744073709551615, 9223372036854775807, 9223372036854775807);
-- n^3 covers all double delta storage cases, from small difference between neighbouref_values (stride) to big. -- n^3 covers all double delta storage cases, from small difference between neighbouref_values (stride) to big.
INSERT INTO codecTest (key, ref_valueU64, valueU64, ref_valueU32, valueU32, ref_valueU16, valueU16, ref_valueU8, valueU8, ref_valueI64, valueI64, ref_valueI32, valueI32, ref_valueI16, valueI16, ref_valueI8, valueI8, ref_valueDT, valueDT, ref_valueD, valueD) INSERT INTO codecTest (key, ref_valueU64, valueU64, ref_valueU32, valueU32, ref_valueU16, valueU16, ref_valueU8, valueU8, ref_valueI64, valueI64, ref_valueI32, valueI32, ref_valueI16, valueI16, ref_valueI8, valueI8, ref_valueDT, valueDT, ref_valueD, valueD)
SELECT number as n, n * n * n as v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, toDateTime(v), toDateTime(v), toDate(v), toDate(v) SELECT number as n, n * n * n as v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, toDateTime(v), toDateTime(v), toDate(v), toDate(v)
FROM system.numbers LIMIT 101, 1000; FROM system.numbers LIMIT 101, 1000;
-- best case - constant stride -- best case - constant stride
INSERT INTO codecTest (key, ref_valueU64, valueU64, ref_valueU32, valueU32, ref_valueU16, valueU16, ref_valueU8, valueU8, ref_valueI64, valueI64, ref_valueI32, valueI32, ref_valueI16, valueI16, ref_valueI8, valueI8, ref_valueDT, valueDT, ref_valueD, valueD) INSERT INTO codecTest (key, ref_valueU64, valueU64, ref_valueU32, valueU32, ref_valueU16, valueU16, ref_valueU8, valueU8, ref_valueI64, valueI64, ref_valueI32, valueI32, ref_valueI16, valueI16, ref_valueI8, valueI8, ref_valueDT, valueDT, ref_valueD, valueD)
SELECT number as n, n as v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, toDateTime(v), toDateTime(v), toDate(v), toDate(v) SELECT number as n, n as v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, toDateTime(v), toDateTime(v), toDate(v), toDate(v)
FROM system.numbers LIMIT 2001, 1000; FROM system.numbers LIMIT 2001, 1000;
-- worst case - random stride -- worst case - random stride
INSERT INTO codecTest (key, ref_valueU64, valueU64, ref_valueU32, valueU32, ref_valueU16, valueU16, ref_valueU8, valueU8, ref_valueI64, valueI64, ref_valueI32, valueI32, ref_valueI16, valueI16, ref_valueI8, valueI8, ref_valueDT, valueDT, ref_valueD, valueD) INSERT INTO codecTest (key, ref_valueU64, valueU64, ref_valueU32, valueU32, ref_valueU16, valueU16, ref_valueU8, valueU8, ref_valueI64, valueI64, ref_valueI32, valueI32, ref_valueI16, valueI16, ref_valueI8, valueI8, ref_valueDT, valueDT, ref_valueD, valueD)
SELECT number as n, n + (rand64() - 9223372036854775807)/1000 as v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, toDateTime(v), toDateTime(v), toDate(v), toDate(v) SELECT number as n, n + (rand64() - 9223372036854775807)/1000 as v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, v, toDateTime(v), toDateTime(v), toDate(v), toDate(v)
FROM system.numbers LIMIT 3001, 1000; FROM system.numbers LIMIT 3001, 1000;
SELECT 'U64'; SELECT 'U64';
SELECT SELECT
key, key,
ref_valueU64, valueU64, ref_valueU64 - valueU64 as dU64 ref_valueU64, valueU64, ref_valueU64 - valueU64 as dU64
FROM codecTest FROM codecTest
WHERE WHERE
dU64 != 0 dU64 != 0
LIMIT 10; LIMIT 10;
SELECT 'U32'; SELECT 'U32';
SELECT SELECT
key, key,
ref_valueU32, valueU32, ref_valueU32 - valueU32 as dU32 ref_valueU32, valueU32, ref_valueU32 - valueU32 as dU32
FROM codecTest FROM codecTest
WHERE WHERE
dU32 != 0 dU32 != 0
LIMIT 10; LIMIT 10;
SELECT 'U16'; SELECT 'U16';
SELECT SELECT
key, key,
ref_valueU16, valueU16, ref_valueU16 - valueU16 as dU16 ref_valueU16, valueU16, ref_valueU16 - valueU16 as dU16
FROM codecTest FROM codecTest
WHERE WHERE
dU16 != 0 dU16 != 0
LIMIT 10; LIMIT 10;
SELECT 'U8'; SELECT 'U8';
SELECT SELECT
key, key,
ref_valueU8, valueU8, ref_valueU8 - valueU8 as dU8 ref_valueU8, valueU8, ref_valueU8 - valueU8 as dU8
FROM codecTest FROM codecTest
WHERE WHERE
dU8 != 0 dU8 != 0
LIMIT 10; LIMIT 10;
SELECT 'I64'; SELECT 'I64';
SELECT SELECT
key, key,
ref_valueI64, valueI64, ref_valueI64 - valueI64 as dI64 ref_valueI64, valueI64, ref_valueI64 - valueI64 as dI64
FROM codecTest FROM codecTest
WHERE WHERE
dI64 != 0 dI64 != 0
LIMIT 10; LIMIT 10;
SELECT 'I32'; SELECT 'I32';
SELECT SELECT
key, key,
ref_valueI32, valueI32, ref_valueI32 - valueI32 as dI32 ref_valueI32, valueI32, ref_valueI32 - valueI32 as dI32
FROM codecTest FROM codecTest
WHERE WHERE
dI32 != 0 dI32 != 0
LIMIT 10; LIMIT 10;
SELECT 'I16'; SELECT 'I16';
SELECT SELECT
key, key,
ref_valueI16, valueI16, ref_valueI16 - valueI16 as dI16 ref_valueI16, valueI16, ref_valueI16 - valueI16 as dI16
FROM codecTest FROM codecTest
WHERE WHERE
dI16 != 0 dI16 != 0
LIMIT 10; LIMIT 10;
SELECT 'I8'; SELECT 'I8';
SELECT SELECT
key, key,
ref_valueI8, valueI8, ref_valueI8 - valueI8 as dI8 ref_valueI8, valueI8, ref_valueI8 - valueI8 as dI8
FROM codecTest FROM codecTest
WHERE WHERE
dI8 != 0 dI8 != 0
LIMIT 10; LIMIT 10;
SELECT 'DT'; SELECT 'DT';
SELECT SELECT
key, key,
ref_valueDT, valueDT, ref_valueDT - valueDT as dDT ref_valueDT, valueDT, ref_valueDT - valueDT as dDT
FROM codecTest FROM codecTest
WHERE WHERE
dDT != 0 dDT != 0
LIMIT 10; LIMIT 10;
SELECT 'D'; SELECT 'D';
SELECT SELECT
key, key,
ref_valueD, valueD, ref_valueD - valueD as dD ref_valueD, valueD, ref_valueD - valueD as dD
FROM codecTest FROM codecTest
WHERE WHERE
dD != 0 dD != 0
LIMIT 10; LIMIT 10;
SELECT 'Compression:'; SELECT 'Compression:';
SELECT SELECT
table, name, type, table, name, type,
compression_codec, compression_codec,
data_uncompressed_bytes u, data_uncompressed_bytes u,
data_compressed_bytes c, data_compressed_bytes c,
round(u/c,3) ratio round(u/c,3) ratio
FROM system.columns FROM system.columns
WHERE WHERE
table == 'codecTest' table == 'codecTest'
AND AND
compression_codec != '' compression_codec != ''
AND AND
ratio <= 1 ratio <= 1
ORDER BY ORDER BY
table, name, type; table, name, type;
DROP TABLE IF EXISTS codecTest; DROP TABLE IF EXISTS codecTest;