功能与Yandex的工作。梅特里卡词典
For information about creating reference lists, see the section «Dictionaries».
ClickHouse支持同时使用多个备选地理基(区域层次结构),以支持某些地区所属国家的各种观点。
该 ‘clickhouse-server’ config指定具有区域层次结构的文件::
除了这个文件,它还搜索附近有_符号和任何后缀附加到名称(文件扩展名之前)的文件。
例如,它还会找到该文件 /opt/geo/regions_hierarchy_ua.txt
,如果存在。
被称为字典键。 对于没有后缀的字典,键是空字符串。
All functions for working with regions have an optional argument at the end – the dictionary key. It is referred to as the geobase.
示例:
Accepts a UInt32 number – the region ID from the Yandex geobase. If this region is a city or part of a city, it returns the region ID for the appropriate city. Otherwise, returns 0.
虏茅驴麓卤戮碌禄路戮鲁拢])
将区域转换为区域(地理数据库中的类型5)。 在所有其他方式,这个功能是一样的 ‘regionToCity’.
regionToDistrict(id[,geobase])
将区域转换为联邦区(地理数据库中的类型4)。 在所有其他方式,这个功能是一样的 ‘regionToCity’.
将区域转换为国家。 在所有其他方式,这个功能是一样的 ‘regionToCity’.
示例: regionToCountry(toUInt32(213)) = 225
转换莫斯科(213)到俄罗斯(225)。
掳胫((禄脢鹿脷露胫鲁隆鹿((酶-11-16””[脪陆,ase])
ツ环板(ョツ嘉ッツ偲青regionャツ静ャツ青サツ催ャツ渉])
获取区域的人口。
The population can be recorded in files with the geobase. See the section «External dictionaries».
如果没有为该区域记录人口,则返回0。
在Yandex地理数据库中,可能会为子区域记录人口,但不会为父区域记录人口。
检查是否 ‘lhs’ 属于一个区域 ‘rhs’ 区域。 如果属于UInt8,则返回等于1的数字,如果不属于则返回0。
The relationship is reflexive – any region also belongs to itself.
ツ暗ェツ氾环催ツ団ツ法ツ人])
Accepts a UInt32 number – the region ID from the Yandex geobase. Returns an array of region IDs consisting of the passed region and all parents along the chain.
示例: regionHierarchy(toUInt32(213)) = [213,1,3,225,10001,10000]
.
地区名称(id[,郎])
Accepts a UInt32 number – the region ID from the Yandex geobase. A string with the name of the language can be passed as a second argument. Supported languages are: ru, en, ua, uk, by, kz, tr. If the second argument is omitted, the language ‘ru’ is used. If the language is not supported, an exception is thrown. Returns a string – the name of the region in the corresponding language. If the region with the specified ID doesn’t exist, an empty string is returned.
和 uk
都意味着乌克兰。