mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Update splitting-merging-functions.md
This commit is contained in:
parent
3d4b4af307
commit
1070ad10f3
@ -232,32 +232,6 @@ SELECT alphaTokens('abca1abc');
|
||||
└─────────────────────────┘
|
||||
```
|
||||
|
||||
## tokens {#tokens}
|
||||
|
||||
Splits a string into tokens using non-alphanumeric ASCII characters as separators.
|
||||
|
||||
**Arguments**
|
||||
|
||||
- `input_string` — The set of bytes. [String](../../sql-reference/data-types/string.md).
|
||||
|
||||
**Returned value**
|
||||
|
||||
Returns an array of tokens from input string.
|
||||
|
||||
Type: [Array](../data-types/array.md).
|
||||
|
||||
**Example**
|
||||
|
||||
``` sql
|
||||
SELECT tokens('test1,;\\ test2,;\\ test3,;\\ test4') AS tokens;
|
||||
```
|
||||
|
||||
``` text
|
||||
┌─tokens────────────────────────────┐
|
||||
│ ['test1','test2','test3','test4'] │
|
||||
└───────────────────────────────────┘
|
||||
```
|
||||
|
||||
## extractAllGroups(text, regexp) {#extractallgroups}
|
||||
|
||||
Extracts all groups from non-overlapping substrings matched by a regular expression.
|
||||
@ -296,40 +270,3 @@ Result:
|
||||
│ [['abc','123'],['8','"hkl"']] │
|
||||
└───────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## ngrams {#ngrams}
|
||||
|
||||
Splits the UTF-8 string into n-grams of `ngramsize` symbols.
|
||||
|
||||
**Syntax**
|
||||
|
||||
``` sql
|
||||
ngrams(string, ngramsize)
|
||||
```
|
||||
|
||||
**Arguments**
|
||||
|
||||
- `string` — String. [String](../../sql-reference/data-types/string.md) or [FixedString](../../sql-reference/data-types/fixedstring.md).
|
||||
- `ngramsize` — The size of an n-gram. [UInt](../../sql-reference/data-types/int-uint.md).
|
||||
|
||||
**Returned values**
|
||||
|
||||
- Array with n-grams.
|
||||
|
||||
Type: [Array](../../sql-reference/data-types/array.md)([FixedString](../../sql-reference/data-types/fixedstring.md)).
|
||||
|
||||
**Example**
|
||||
|
||||
Query:
|
||||
|
||||
``` sql
|
||||
SELECT ngrams('ClickHouse', 3);
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
┌─ngrams('ClickHouse', 3)───────────────────────────┐
|
||||
│ ['Cli','lic','ick','ckH','kHo','Hou','ous','use'] │
|
||||
└───────────────────────────────────────────────────┘
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user