2018-12-17 20:07:31 +00:00
|
|
|
<test>
|
|
|
|
|
2020-03-03 13:38:20 +00:00
|
|
|
<create_query>
|
|
|
|
create table if not exists whitespaces
|
|
|
|
engine = MergeTree() partition by tuple() order by tuple()
|
|
|
|
as
|
|
|
|
with 32 - log2(intHash32(number)) + 1 as num_spaces,
|
|
|
|
repeat(' ', toUInt32(num_spaces)) as spaces
|
|
|
|
select spaces || toString(number) || spaces value
|
|
|
|
from numbers_mt(100000000);
|
|
|
|
</create_query>
|
2018-12-17 20:07:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<substitutions>
|
|
|
|
<substitution>
|
2019-07-27 21:17:44 +00:00
|
|
|
<name>func</name>
|
2018-12-17 20:07:31 +00:00
|
|
|
<values>
|
|
|
|
<value>trimLeft(value)</value>
|
|
|
|
<value>trimRight(value)</value>
|
|
|
|
<value>trimBoth(value)</value>
|
2020-03-03 13:38:20 +00:00
|
|
|
</values>
|
|
|
|
</substitution>
|
|
|
|
<substitution>
|
|
|
|
<name>func_slow</name>
|
|
|
|
<values>
|
2018-12-17 20:07:31 +00:00
|
|
|
<value>replaceRegexpOne(value, '^ *', '')</value>
|
|
|
|
<value>replaceRegexpOne(value, ' *$', '')</value>
|
|
|
|
<value>replaceRegexpAll(value, '^ *| *$', '')</value>
|
|
|
|
</values>
|
|
|
|
</substitution>
|
|
|
|
</substitutions>
|
|
|
|
|
2020-03-03 13:38:20 +00:00
|
|
|
<query>SELECT {func} FROM whitespaces FORMAT Null</query>
|
|
|
|
<query>SELECT {func_slow} FROM whitespaces LIMIT 10000000 FORMAT Null</query>
|
2019-02-01 15:10:13 +00:00
|
|
|
|
|
|
|
<drop_query>DROP TABLE IF EXISTS whitespaces</drop_query>
|
2018-12-17 20:07:31 +00:00
|
|
|
</test>
|