mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
Merge pull request #12619 from BayoNet/docs/CLICKHOUSEDOCS-654-randomStringUTF8
DOCS-654: randomStringUTF8
This commit is contained in:
commit
a78b58d764
@ -1350,4 +1350,42 @@ len: 30
|
||||
- [generateRandom](../../sql-reference/table-functions/generate.md#generaterandom)
|
||||
- [randomPrintableASCII](../../sql-reference/functions/other-functions.md#randomascii)
|
||||
|
||||
|
||||
## randomStringUTF8 {#randomstringutf8}
|
||||
|
||||
Generates a random string of a specified length. Result string contains valid UTF-8 code points. The value of code points may be outside of the range of assigned Unicode.
|
||||
|
||||
**Syntax**
|
||||
|
||||
``` sql
|
||||
randomStringUTF8(length);
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `length` — Required length of the resulting string in code points. [UInt64](../../sql-reference/data-types/int-uint.md).
|
||||
|
||||
**Returned value(s)**
|
||||
|
||||
- UTF-8 random string.
|
||||
|
||||
Type: [String](../../sql-reference/data-types/string.md).
|
||||
|
||||
**Example**
|
||||
|
||||
Query:
|
||||
|
||||
```sql
|
||||
SELECT randomStringUTF8(13)
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
```text
|
||||
┌─randomStringUTF8(13)─┐
|
||||
│ 𘤗д兠庇 │
|
||||
└──────────────────────┘
|
||||
|
||||
```
|
||||
|
||||
[Original article](https://clickhouse.tech/docs/en/query_language/functions/other_functions/) <!--hide-->
|
||||
|
@ -1334,4 +1334,42 @@ len: 30
|
||||
- [randomPrintableASCII](../../sql-reference/functions/other-functions.md#randomascii)
|
||||
|
||||
|
||||
## randomStringUTF8 {#randomstringutf8}
|
||||
|
||||
Генерирует строку определенной длины со случайной строкой в кодировке UTF-8.
|
||||
|
||||
**Синтаксис**
|
||||
|
||||
``` sql
|
||||
randomStringUTF8(length);
|
||||
```
|
||||
|
||||
**Параметры**
|
||||
|
||||
- `length` — Длина итоговой строки в кодовых точках. [UInt64](../../sql-reference/data-types/int-uint.md).
|
||||
|
||||
**Возвращаемое значение**
|
||||
|
||||
- Случайная строка в кодировке UTF-8.
|
||||
|
||||
Тип: [String](../../sql-reference/data-types/string.md).
|
||||
|
||||
**Пример**
|
||||
|
||||
Запрос:
|
||||
|
||||
```sql
|
||||
SELECT randomStringUTF8(13)
|
||||
```
|
||||
|
||||
Результат:
|
||||
|
||||
```text
|
||||
┌─randomStringUTF8(13)─┐
|
||||
│ 𘤗д兠庇 │
|
||||
└──────────────────────┘
|
||||
|
||||
```
|
||||
|
||||
|
||||
[Оригинальная статья](https://clickhouse.tech/docs/ru/query_language/functions/other_functions/) <!--hide-->
|
||||
|
Loading…
Reference in New Issue
Block a user