未验证 提交 19c3939b 编写于 作者: A AsiaKorushkina 提交者: GitHub

asiana21 DOCSUP-658 (#93)

* docs(regionToTopContinent): part of the function description

* docs(regionToTopContinent): some shanges are added in the description

* Update docs/en/query_language/functions/ym_dict_functions.md
Co-Authored-By: NBayoNet <da-daos@yandex.ru>

* Update docs/en/query_language/functions/ym_dict_functions.md
Co-Authored-By: NBayoNet <da-daos@yandex.ru>

* Update docs/en/query_language/functions/ym_dict_functions.md
Co-Authored-By: NBayoNet <da-daos@yandex.ru>

* Update docs/en/query_language/functions/ym_dict_functions.md
Co-Authored-By: NBayoNet <da-daos@yandex.ru>

* docs(regionToTopContinent): some shanges

* docs(regionToTopContinent): added translation of the function description
Co-authored-by: Nasiana21 <asiana21@yandex-team.ru>
Co-authored-by: NBayoNet <da-daos@yandex.ru>
上级 f3423b18
......@@ -4,7 +4,7 @@ In order for the functions below to work, the server config must specify the pat
For information about creating reference lists, see the section "Dictionaries".
## Multiple geobases
## Multiple Geobases {#multiplegeobases}
ClickHouse supports working with multiple alternative geobases (regional hierarchies) simultaneously, in order to support various perspectives on which countries certain regions belong to.
......@@ -100,6 +100,30 @@ Example: `regionToCountry(toUInt32(213)) = 225` converts Moscow (213) to Russia
Converts a region to a continent. In every other way, this function is the same as 'regionToCity'.
Example: `regionToContinent(toUInt32(213)) = 10001` converts Moscow (213) to Eurasia (10001).
### regionToTopContinent (#regiontotopcontinent)
Finds the highest continent in the hierarchy for the region.
**Syntax**
```sql
regionToTopContinent(id[, geobase]);
```
**Parameters**
- `id` — Region ID from the Yandex geobase. [UInt32](../../data_types/int_uint.md).
- `geobase` — Dictionary key. See [Multiple Geobases](#multiplegeobases). [String](../../data_types/string.md). Optional.
**Returned value**
- Identifier of the top level continent (the latter when you climb the hierarchy of regions).
- 0, if there is none.
Type: `UInt32`.
### regionToPopulation(id[, geobase])
Gets the population for a region.
......
......@@ -4,7 +4,7 @@
О том, как создать справочники, смотрите в разделе "Словари".
## Множественные геобазы
## Множественные геобазы {#multiplegeobases}
ClickHouse поддерживает работу одновременно с несколькими альтернативными геобазами (иерархиями регионов), для того чтобы можно было поддержать разные точки зрения о принадлежности регионов странам.
......@@ -96,6 +96,28 @@ LIMIT 15
Переводит регион в континент. В остальном, аналогично функции regionToCity.
Пример: `regionToContinent(toUInt32(213)) = 10001` - преобразовали Москву (213) в Евразию (10001).
### regionToTopContinent (#regiontotopcontinent)
Находит для региона верхний в иерархии континент.
**Синтаксис**
```sql
regionToTopContinent(id[, geobase]);
```
**Параметры**
- `id` — Идентификатор региона из геобазы Яндекса. [UInt32](../../data_types/int_uint.md).
- `geobase` — Ключ словаря. Смотрите [Множественные геобазы](#multiplegeobases). [String](../../data_types/string.md). Опциональный параметр.
**Возвращаемое значение**
- Идентификатор верхнего уровня континента (последний при подъеме по иерархии регионов).
- 0, если его нет.
Тип: `UInt32`.
### regionToPopulation(id\[, geobase\])
Получает население для региона.
Население может быть прописано в файлах с геобазой. Смотрите в разделе "Встроенные словари".
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册