I described function randomStringUTF8 (#146)

* I described function randomStringUTF8

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql-reference/functions/other-functions.md

Co-authored-by: BayoNet <da-daos@yandex.ru>

* Ive edited en-version and translated function description to Russian.

Co-authored-by: BayoNet <da-daos@yandex.ru>
This commit is contained in:
AnaUvarova 2020-07-21 13:08:11 +03:00 committed by GitHub
parent ad37660b1a
commit 0d0ce4b760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 74 additions and 0 deletions

View File

@ -1200,4 +1200,41 @@ SELECT number, randomPrintableASCII(30) as str, length(str) FROM system.numbers
└────────┴────────────────────────────────┴──────────────────────────────────┘
```
## randomStringUTF8 {#randomstringutf8}
Generates a random string of a specified length. Result string contains valid UTF-8 symbols.
**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-->

View File

@ -1153,4 +1153,41 @@ SELECT number, randomPrintableASCII(30) as str, length(str) FROM system.numbers
└────────┴────────────────────────────────┴──────────────────────────────────┘
```
## 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-->