Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

dictionary

Exibe os dados do dicionário como uma tabela do ClickHouse. Funciona da mesma forma que o motor Dicionário.

Sintaxe

dictionary('dict')

Argumentos

  • dict — Nome de um dicionário. String.

Valor retornado

Uma tabela do ClickHouse.

Exemplos

Tabela de entrada dictionary_source_table:

┌─id─┬─value─┐
│  0 │     0 │
│  1 │     1 │
└────┴───────┘

Crie um dicionário:

Querysql
CREATE DICTIONARY new_dictionary(id UInt64, value UInt64 DEFAULT 0) PRIMARY KEY id
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dictionary_source_table')) LAYOUT(DIRECT());
Querysql
SELECT * FROM dictionary('new_dictionary');
Responsetext
┌─id─┬─value─┐
│  0 │     0 │
│  1 │     1 │
└────┴───────┘
Navigation