2023-09-23 04:52:31 +00:00
|
|
|
select byteHammingDistance('abcd', 'abcd');
|
2023-09-22 17:43:52 +00:00
|
|
|
drop table if exists t;
|
|
|
|
create table t
|
|
|
|
(
|
|
|
|
s1 String,
|
|
|
|
s2 String
|
|
|
|
) engine = MergeTree order by s1;
|
|
|
|
|
|
|
|
insert into t values ('abcdefg', 'abcdef') ('abcdefg', 'bcdefg') ('abcdefg', '');
|
|
|
|
|
2023-09-23 04:52:31 +00:00
|
|
|
select byteHammingDistance(s1, s2) from t;
|
2023-09-22 17:43:52 +00:00
|
|
|
|
2023-09-23 04:52:31 +00:00
|
|
|
select byteHammingDistance('abc', s2) from t;
|
2023-09-22 17:43:52 +00:00
|
|
|
|
2023-09-23 04:52:31 +00:00
|
|
|
select byteHammingDistance(s2, 'def') from t;
|
2023-09-22 17:43:52 +00:00
|
|
|
|
|
|
|
drop table t;
|