Added documentation

This commit is contained in:
Maksim Kita 2021-10-14 13:15:45 +03:00
parent e6bca4d928
commit 562c8984a4
2 changed files with 27 additions and 3 deletions

View File

@ -28,7 +28,7 @@ The function also works for [arrays](array-functions.md#function-empty) or [UUID
**Returned value**
- Returns `1` for an empty string or `0` for a non-empty string.
- Returns `1` for an empty string or `0` for a non-empty string.
Type: [UInt8](../data-types/int-uint.md).
@ -68,7 +68,7 @@ The function also works for [arrays](array-functions.md#function-notempty) or [U
**Returned value**
- Returns `1` for a non-empty string or `0` for an empty string string.
- Returns `1` for a non-empty string or `0` for an empty string string.
Type: [UInt8](../data-types/int-uint.md).
@ -313,6 +313,30 @@ SELECT toValidUTF8('\x61\xF0\x80\x80\x80b');
└───────────────────────┘
```
## tokens {#tokens}
Split string into tokens using non-alpha numeric ASCII characters as separators.
**Arguments**
- `input_string` — Any set of bytes represented as the [String](../../sql-reference/data-types/string.md) data type object.
**Returned value**
- The resulting array of tokens from input string.
Type: [Array](../data-types/array.md).
**Example**
```
SELECT tokens('test1,;\\ test2,;\\ test3,;\\ test4') AS tokens;
```
``` text
SELECT tokens('test1,;\\ test2,;\\ test3,;\\ test4') AS tokens
```
## repeat {#repeat}
Repeats a string as many times as specified and concatenates the replicated values as a single string.

View File

@ -53,7 +53,7 @@ public:
auto ngram_input_argument_type = WhichDataType(arguments[0].type);
if (!ngram_input_argument_type.isStringOrFixedString())
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"Function {} second argument type should be String or FixedString. Actual {}",
"Function {} first argument type should be String or FixedString. Actual {}",
getName(),
arguments[0].type->getName());