ClickHouse/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict.md

1.5 KiB
Raw Blame History

slug machine_translated machine_translated_rev sidebar_position sidebar_label
/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict true 72537a2d52 40 配置外部字典

配置外部字典

如果使用xml文件配置字典则比字典配置具有以下结构:

<dictionary>
    <name>dict_name</name>

    <structure>
      <!-- Complex key configuration -->
    </structure>

    <source>
      <!-- Source configuration -->
    </source>

    <layout>
      <!-- Memory layout configuration -->
    </layout>

    <lifetime>
      <!-- Lifetime of dictionary in memory -->
    </lifetime>
</dictionary>

相应的 DDL-查询 具有以下结构:

CREATE DICTIONARY dict_name
(
    ... -- attributes
)
PRIMARY KEY ... -- complex or single key configuration
SOURCE(...) -- Source configuration
LAYOUT(...) -- Memory layout configuration
LIFETIME(...) -- Lifetime of dictionary in memory
  • name The identifier that can be used to access the dictionary. Use the characters [a-zA-Z0-9_\-].
  • 来源 — Source of the dictionary.
  • 布局 — Dictionary layout in memory.
  • 结构 — Structure of the dictionary . A key and attributes that can be retrieved by this key.
  • 使用寿命 — Frequency of dictionary updates.