mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
DOCS-679: netloc function (#12321)
* DOCSUP-1377 (netloc function) (#135) * add EN description * changes in query * changes after review * add RU description * CLICKHOUSEDOCS-679: Text fixes. Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru> Co-authored-by: emironyuk <em@don.ru> Co-authored-by: Evgenia Sudarikova <56156889+otrazhenia@users.noreply.github.com>
This commit is contained in:
parent
827990d681
commit
2eb6f1d0c1
@ -184,6 +184,42 @@ SELECT decodeURLComponent('http://127.0.0.1:8123/?query=SELECT%201%3B') AS Decod
|
||||
└────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### netloc {#netloc}
|
||||
|
||||
Extracts network locality (`username:password@host:port`) from a URL.
|
||||
|
||||
**Syntax**
|
||||
|
||||
```sql
|
||||
netloc(URL)
|
||||
```
|
||||
|
||||
**Parameters**
|
||||
|
||||
- `url` — URL. [String](../../sql-reference/data-types/string.md).
|
||||
|
||||
**Returned value**
|
||||
|
||||
- `username:password@host:port`.
|
||||
|
||||
Type: `String`.
|
||||
|
||||
**Example**
|
||||
|
||||
Query:
|
||||
|
||||
``` sql
|
||||
SELECT netloc('http://paul@www.example.com:80/');
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
``` text
|
||||
┌─netloc('http://paul@www.example.com:80/')─┐
|
||||
│ paul@www.example.com:80 │
|
||||
└───────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Functions that Remove Part of a URL {#functions-that-remove-part-of-a-url}
|
||||
|
||||
If the URL doesn’t have anything similar, the URL remains unchanged.
|
||||
|
@ -174,6 +174,42 @@ SELECT decodeURLComponent('http://127.0.0.1:8123/?query=SELECT%201%3B') AS Decod
|
||||
└────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### netloc {#netloc}
|
||||
|
||||
Извлекает сетевую локальность (`username:password@host:port`) из URL.
|
||||
|
||||
**Синтаксис**
|
||||
|
||||
```sql
|
||||
netloc(URL)
|
||||
```
|
||||
|
||||
**Параметры**
|
||||
|
||||
- `url` — URL. Тип — [String](../../sql-reference/data-types/string.md).
|
||||
|
||||
**Возвращаемое значение**
|
||||
|
||||
- `username:password@host:port`.
|
||||
|
||||
Тип: `String`.
|
||||
|
||||
**Пример**
|
||||
|
||||
Запрос:
|
||||
|
||||
``` sql
|
||||
SELECT netloc('http://paul@www.example.com:80/');
|
||||
```
|
||||
|
||||
Результат:
|
||||
|
||||
``` text
|
||||
┌─netloc('http://paul@www.example.com:80/')─┐
|
||||
│ paul@www.example.com:80 │
|
||||
└───────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## Функции, удаляющие часть из URL-а {#funktsii-udaliaiushchie-chast-iz-url-a}
|
||||
|
||||
Если в URL-е нет ничего похожего, то URL остаётся без изменений.
|
||||
|
Loading…
Reference in New Issue
Block a user