mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
838596c7a4
Function to count number of substring occurrences in the string: - in case of needle is multi char - counts non-intersecting substrings - the code is based on position helpers. The following new functions is available: - countSubstrings() - countSubstringsCaseInsensitive() - countSubstringsCaseInsensitiveUTF8() v0: substringCount() v2: - add substringCountCaseInsensitiveUTF8 - improve tests - fix coding style issues - fix multichar needle v3: rename to countSubstrings (by analogy with countEqual())
112 lines
941 B
Plaintext
112 lines
941 B
Plaintext
|
|
# countSubstrings
|
|
|
|
CountSubstringsImpl::constantConstant
|
|
CountSubstringsImpl::constantConstantScalar
|
|
empty
|
|
0
|
|
0
|
|
0
|
|
char
|
|
1
|
|
2
|
|
3
|
|
word
|
|
1
|
|
1
|
|
1
|
|
2
|
|
3
|
|
intersect
|
|
2
|
|
|
|
CountSubstringsImpl::vectorVector
|
|
1
|
|
4
|
|
6
|
|
"intersect",4
|
|
|
|
CountSubstringsImpl::constantVector
|
|
2
|
|
1
|
|
0
|
|
3
|
|
5
|
|
"intersect",4
|
|
|
|
CountSubstringsImpl::vectorConstant
|
|
0
|
|
1
|
|
2
|
|
3
|
|
4
|
|
"intersect",4
|
|
|
|
# countSubstringsCaseInsensitive
|
|
|
|
CountSubstringsImpl::constantConstant
|
|
CountSubstringsImpl::constantConstantScalar
|
|
char
|
|
1
|
|
2
|
|
3
|
|
word
|
|
1
|
|
1
|
|
1
|
|
2
|
|
3
|
|
intersect
|
|
2
|
|
|
|
CountSubstringsImpl::vectorVector
|
|
1
|
|
3
|
|
5
|
|
|
|
CountSubstringsImpl::constantVector
|
|
2
|
|
1
|
|
0
|
|
3
|
|
5
|
|
|
|
CountSubstringsImpl::vectorConstant
|
|
1
|
|
0
|
|
0
|
|
|
|
# countSubstringsCaseInsensitiveUTF8
|
|
|
|
CountSubstringsImpl::constantConstant
|
|
CountSubstringsImpl::constantConstantScalar
|
|
char
|
|
1
|
|
2
|
|
3
|
|
word
|
|
1
|
|
1
|
|
1
|
|
2
|
|
3
|
|
intersect
|
|
2
|
|
|
|
CountSubstringsImpl::vectorVector
|
|
1
|
|
3
|
|
5
|
|
"intersect",4
|
|
|
|
CountSubstringsImpl::constantVector
|
|
2
|
|
3
|
|
5
|
|
"intersect",4
|
|
|
|
CountSubstringsImpl::vectorConstant
|
|
1
|
|
0
|
|
"intersect",4
|