dictionary

Displays the dictionary data as a ClickHouse table. Works the same way as Dictionary engine.

Syntax

  1. dictionary('dict')

Arguments

  • dict — A dictionary name. String.

Returned value

A ClickHouse table.

Example

Input table dictionary_source_table:

  1. ┌─id─┬─value─┐
  2. 0 0
  3. 1 1
  4. └────┴───────┘

Create a dictionary:

  1. CREATE DICTIONARY new_dictionary(id UInt64, value UInt64 DEFAULT 0) PRIMARY KEY id
  2. SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dictionary_source_table')) LAYOUT(DIRECT());

Query:

  1. SELECT * FROM dictionary('new_dictionary');

Result:

  1. ┌─id─┬─value─┐
  2. 0 0
  3. 1 1
  4. └────┴───────┘

See Also