ClickHouse/docs/en/sql-reference/table-functions/dictionary.md
Dmitriy b5421209e3 Fix link
Поправил ссылку.
2021-05-19 18:20:52 +03:00

1.1 KiB

toc_priority toc_title
54 dictionary function

dictionary

Displays the dictionary data as a ClickHouse table.

Syntax

dictionary('dict')

Arguments

  • dict — A dictionary name. String.

Returned value

A ClickHouse table.

Example

Input table:

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

Create a dictionary:

CREATE DICTIONARY table_function_dictionary_test_dictionary(id UInt64, value UInt64 DEFAULT 0) PRIMARY KEY id
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_function_dictionary_source_table'))
LAYOUT(DIRECT());

Query:

SELECT * FROM dictionary('table_function_dictionary_test_dictionary');

Result:

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

See Also