ClickHouse/tests/queries/0_stateless/01284_fuzz_bits.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
759 B
MySQL
Raw Normal View History

2020-05-29 11:38:20 +00:00
SELECT fuzzBits(toString('string'), 1); -- { serverError 43 }
2020-05-31 23:40:38 +00:00
SELECT fuzzBits('string', -1.0); -- { serverError 69 }
2020-05-29 11:38:20 +00:00
SELECT fuzzBits('', 0.3);
SELECT length(fuzzBits(randomString(100), 0.5));
SELECT toTypeName(fuzzBits(randomString(100), 0.5));
SELECT toTypeName(fuzzBits(toFixedString('abacaba', 10), 0.9));
2020-05-29 02:06:21 +00:00
SELECT
(
2020-05-30 05:47:05 +00:00
0.29 * 8 * 10000 < sum
AND sum < 0.31 * 8 * 10000
2020-05-29 02:06:21 +00:00
) AS res
FROM
(
SELECT
arraySum(
id -> bitCount(
reinterpretAsUInt8(
substring(
fuzzBits(
arrayStringConcat(arrayMap(x -> toString('\0'), range(10000))),
0.3
),
id + 1,
1
)
)
),
range(10000)
) as sum
)