ClickHouse/docs/ru/query_language/functions/ext_dict_functions.md
ogorbacheva e275094f7d Added info about UUID to russian doc (#4314)
* Adding UUID to "ru" (drafts)

* fix russian text

* Adding UUID to "ru" (drafts)

* fix russian text

* fix english doc

* fixing links to nowhere
2019-02-09 00:37:56 +03:00

41 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Функции для работы с внешними словарями {#ext_dict_functions}
Информация о подключении и настройке внешних словарей смотрите в разделе [Внешние словари](../dicts/external_dicts.md).
## dictGetUInt8, dictGetUInt16, dictGetUInt32, dictGetUInt64
## dictGetInt8, dictGetInt16, dictGetInt32, dictGetInt64
## dictGetFloat32, dictGetFloat64
## dictGetDate, dictGetDateTime
## dictGetUUID
## dictGetString
`dictGetT('dict_name', 'attr_name', id)`
- получить из словаря dict_name значение атрибута attr_name по ключу id.
`dict_name` и `attr_name` - константные строки.
`id` должен иметь тип UInt64.
Если ключа `id` нет в словаре - вернуть значение по умолчанию, заданное в описании словаря.
## dictGetTOrDefault
`dictGetT('dict_name', 'attr_name', id, default)`
Аналогично функциям `dictGetT`, но значение по умолчанию берётся из последнего аргумента функции.
## dictIsIn
`dictIsIn('dict_name', child_id, ancestor_id)`
- для иерархического словаря dict_name - узнать, находится ли ключ child_id внутри ancestor_id (или совпадает с ancestor_id). Возвращает UInt8.
## dictGetHierarchy
`dictGetHierarchy('dict_name', id)`
- для иерархического словаря dict_name - вернуть массив ключей словаря, начиная с id и продолжая цепочкой родительских элементов. Возвращает Array(UInt64).
## dictHas
`dictHas('dict_name', id)`
- проверить наличие ключа в словаре. Возвращает значение типа UInt8, равное 0, если ключа нет и 1, если ключ есть.
[Оригинальная статья](https://clickhouse.yandex/docs/ru/query_language/functions/ext_dict_functions/) <!--hide-->