Skip to main content

ListExternalDictionaries

Retrieves a list of external dictionaries that belong to specified cluster.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const ListClusterExternalDictionariesRequest =
cloudApi.mdb.clickhouse_cluster_service
.ListClusterExternalDictionariesRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ClusterServiceClient);

const result = await client.listExternalDictionaries(
ListClusterExternalDictionariesRequest.fromPartial({
clusterId: "clusterId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListClusterExternalDictionariesRequest

clusterId : string

ID of the cluster that the external dictionaries belong to.

pageSize : int64

The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListClusterExternalDictionaryResponse.next_page_token that can be used to get the next page of results in subsequent list requests.

pageToken : string

Page token. To get the next page of results, set page_token to the ListClusterExternalDictionaryResponse.next_page_token returned by a previous list request.

ListClusterExternalDictionariesResponse

externalDictionaries : config.ClickhouseConfig.ExternalDictionary

List of ClickHouse Cluster external dictionaries.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is larger than ListClusterExternalDictionaryRequest.page_size, use the next_page_token as the value for the ListClusterExternalDictionaryRequest.page_token parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

ExternalDictionary

HttpSource
Header
name : string
value : string
url : string

URL of the source dictionary available over HTTP.

format : string

The data format. Valid values are all formats supported by ClickHouse SQL dialect.

headers : Header

HTTP headers.

MysqlSource
Replica
host : string

MySQL host of the replica.

priority : int64

The priority of the replica that ClickHouse takes into account when connecting. Replica with the highest priority should have this field set to the lowest number.

port : int64

Port to use when connecting to the replica. If a port is not specified for a replica, ClickHouse uses the port specified for the source.

user : string

Name of the MySQL database user.

password : string

Password of the MySQL database user.

db : string

Name of the MySQL database to connect to.

table : string

Name of the database table to use as a ClickHouse dictionary.

port : int64

Default port to use when connecting to a replica of the dictionary source.

user : string

Name of the default user for replicas of the dictionary source.

password : string

Password of the default user for replicas of the dictionary source.

replicas : Replica

List of MySQL replicas of the database used as dictionary source.

where : string

Selection criteria for the data in the specified MySQL table.

invalidateQuery : string

Query for checking the dictionary status, to pull only updated data. For more details, see ClickHouse documentation on dictionaries.

closeConnection : google.protobuf.BoolValue

Should the connection be closed after each request.

shareConnection : google.protobuf.BoolValue

Should a connection be shared for some requests.

ClickhouseSource
db : string

Name of the ClickHouse database.

table : string

Name of the table in the specified database to be used as the dictionary source.

host : string

ClickHouse host of the specified database.

port : int64

Port to use when connecting to the host.

user : string

Name of the ClickHouse database user.

password : string

Password of the ClickHouse database user.

where : string

Selection criteria for the data in the specified ClickHouse table.

secure : google.protobuf.BoolValue

Use ssl for connection.

MongodbSource
db : string

Name of the MongoDB database.

collection : string

Name of the collection in the specified database to be used as the dictionary source.

host : string

MongoDB host of the specified database.

port : int64

Port to use when connecting to the host.

user : string

Name of the MongoDB database user.

password : string

Password of the MongoDB database user.

options : string
PostgresqlSource
SslMode
  • SSL_MODE_UNSPECIFIED

  • DISABLE

    Only try a non-SSL connection.

  • ALLOW

    First try a non-SSL connection; if that fails, try an SSL connection.

  • PREFER

    First try an SSL connection; if that fails, try a non-SSL connection.

  • VERIFY_CA

    Only try an SSL connection, and verify that the server certificate is issued by a trusted certificate authority (CA).

  • VERIFY_FULL

    Only try an SSL connection, verify that the server certificate is issued by a trusted CA and that the requested server host name matches that in the certificate.

db : string

Name of the PostrgreSQL database.

table : string

Name of the table in the specified database to be used as the dictionary source.

hosts : string

Name of the PostrgreSQL host

port : int64

Port to use when connecting to the host.

user : string

Name of the PostrgreSQL database user.

password : string

Password of the PostrgreSQL database user.

invalidateQuery : string

Query for checking the dictionary status, to pull only updated data. For more details, see ClickHouse documentation on dictionaries.

sslMode : SslMode

Mode of SSL TCP/IP connection to the PostgreSQL host. For more details, see PostgreSQL documentation.

Structure
Attribute
name : string

Name of the column.

type : string

Type of the column.

nullValue : string

Default value for an element without data (for example, an empty string).

expression : string

Expression, describing the attribute, if applicable.

hierarchical : bool

Indication of hierarchy support. Default value: false.

injective : bool

Indication of injective mapping "id -> attribute". Default value: false.

Id

Numeric key.

name : string

Name of the numeric key.

Key

Complex key.

attributes : Attribute

Attributes of a complex key.

id : Id

Single numeric key column for the dictionary.

key : Key

Composite key for the dictionary, containing of one or more key columns. For details, see ClickHouse documentation.

rangeMin : Attribute

Field holding the beginning of the range for dictionaries with RANGE_HASHED layout. For details, see ClickHouse documentation.

rangeMax : Attribute

Field holding the end of the range for dictionaries with RANGE_HASHED layout. For details, see ClickHouse documentation.

attributes : Attribute

Description of the fields available for database queries. For details, see ClickHouse documentation.

Layout

Layout determining how to store the dictionary in memory.

Type
  • TYPE_UNSPECIFIED

  • FLAT

    The entire dictionary is stored in memory in the form of flat arrays. Available for all dictionary sources.

  • HASHED

    The entire dictionary is stored in memory in the form of a hash table. Available for all dictionary sources.

  • COMPLEX_KEY_HASHED

    Similar to HASHED, to be used with composite keys. Available for all dictionary sources.

  • RANGE_HASHED

    The entire dictionary is stored in memory in the form of a hash table, with an ordered array of ranges and their corresponding values. Available for all dictionary sources.

  • CACHE

    The dictionary is stored in a cache with a set number of cells. Available for MySQL, ClickHouse and HTTP dictionary sources.

  • COMPLEX_KEY_CACHE

    Similar to CACHE, to be used with composite keys. Available for MySQL, ClickHouse and HTTP dictionary sources.

type : Type

Layout type for an external dictionary.

sizeInCells : int64

Number of cells in the cache. Rounded up to a power of two. Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

maxArraySize : int64

Maximum dictionary key size. Applicable only for FLAT layout type.

Range
min : int64

Minimum dictionary lifetime.

max : int64

Maximum dictionary lifetime.

name : string

Name of the external dictionary.

structure : Structure

Set of attributes for the external dictionary. For in-depth description, see ClickHouse documentation.

layout : Layout

Layout for storing the dictionary in memory. For in-depth description, see ClickHouse documentation.

One of lifetime

Setting for the period of time between dictionary updates. For details, see ClickHouse documentation.

  • fixedLifetime : int64

    Fixed interval between dictionary updates.

  • lifetimeRange : Range

    Range of intervals between dictionary updates for ClickHouse to choose from.

One of source

Description of the source for the external dictionary.

  • httpSource : HttpSource

    HTTP source for the dictionary.

  • mysqlSource : MysqlSource

    MySQL source for the dictionary.

  • clickhouseSource : ClickhouseSource

    ClickHouse source for the dictionary.

  • mongodbSource : MongodbSource

    MongoDB source for the dictionary.

  • postgresqlSource : PostgresqlSource

    PostgreSQL source for the dictionary.

Header

name : string
value : string

Replica

host : string

MySQL host of the replica.

priority : int64

The priority of the replica that ClickHouse takes into account when connecting. Replica with the highest priority should have this field set to the lowest number.

port : int64

Port to use when connecting to the replica. If a port is not specified for a replica, ClickHouse uses the port specified for the source.

user : string

Name of the MySQL database user.

password : string

Password of the MySQL database user.

Attribute

name : string

Name of the column.

type : string

Type of the column.

nullValue : string

Default value for an element without data (for example, an empty string).

expression : string

Expression, describing the attribute, if applicable.

hierarchical : bool

Indication of hierarchy support. Default value: false.

injective : bool

Indication of injective mapping "id -> attribute". Default value: false.

Id

Numeric key.

name : string

Name of the numeric key.

Key

Complex key.

attributes : Attribute

Attributes of a complex key.

Structure

Attribute
name : string

Name of the column.

type : string

Type of the column.

nullValue : string

Default value for an element without data (for example, an empty string).

expression : string

Expression, describing the attribute, if applicable.

hierarchical : bool

Indication of hierarchy support. Default value: false.

injective : bool

Indication of injective mapping "id -> attribute". Default value: false.

Id

Numeric key.

name : string

Name of the numeric key.

Key

Complex key.

attributes : Attribute

Attributes of a complex key.

id : Id

Single numeric key column for the dictionary.

key : Key

Composite key for the dictionary, containing of one or more key columns. For details, see ClickHouse documentation.

rangeMin : Attribute

Field holding the beginning of the range for dictionaries with RANGE_HASHED layout. For details, see ClickHouse documentation.

rangeMax : Attribute

Field holding the end of the range for dictionaries with RANGE_HASHED layout. For details, see ClickHouse documentation.

attributes : Attribute

Description of the fields available for database queries. For details, see ClickHouse documentation.

Layout

Layout determining how to store the dictionary in memory.

Type
  • TYPE_UNSPECIFIED

  • FLAT

    The entire dictionary is stored in memory in the form of flat arrays. Available for all dictionary sources.

  • HASHED

    The entire dictionary is stored in memory in the form of a hash table. Available for all dictionary sources.

  • COMPLEX_KEY_HASHED

    Similar to HASHED, to be used with composite keys. Available for all dictionary sources.

  • RANGE_HASHED

    The entire dictionary is stored in memory in the form of a hash table, with an ordered array of ranges and their corresponding values. Available for all dictionary sources.

  • CACHE

    The dictionary is stored in a cache with a set number of cells. Available for MySQL, ClickHouse and HTTP dictionary sources.

  • COMPLEX_KEY_CACHE

    Similar to CACHE, to be used with composite keys. Available for MySQL, ClickHouse and HTTP dictionary sources.

type : Type

Layout type for an external dictionary.

sizeInCells : int64

Number of cells in the cache. Rounded up to a power of two. Applicable only for CACHE and COMPLEX_KEY_CACHE layout types.

maxArraySize : int64

Maximum dictionary key size. Applicable only for FLAT layout type.

Range

min : int64

Minimum dictionary lifetime.

max : int64

Maximum dictionary lifetime.

HttpSource

Header
name : string
value : string
url : string

URL of the source dictionary available over HTTP.

format : string

The data format. Valid values are all formats supported by ClickHouse SQL dialect.

headers : Header

HTTP headers.

MysqlSource

Replica
host : string

MySQL host of the replica.

priority : int64

The priority of the replica that ClickHouse takes into account when connecting. Replica with the highest priority should have this field set to the lowest number.

port : int64

Port to use when connecting to the replica. If a port is not specified for a replica, ClickHouse uses the port specified for the source.

user : string

Name of the MySQL database user.

password : string

Password of the MySQL database user.

db : string

Name of the MySQL database to connect to.

table : string

Name of the database table to use as a ClickHouse dictionary.

port : int64

Default port to use when connecting to a replica of the dictionary source.

user : string

Name of the default user for replicas of the dictionary source.

password : string

Password of the default user for replicas of the dictionary source.

replicas : Replica

List of MySQL replicas of the database used as dictionary source.

where : string

Selection criteria for the data in the specified MySQL table.

invalidateQuery : string

Query for checking the dictionary status, to pull only updated data. For more details, see ClickHouse documentation on dictionaries.

closeConnection : google.protobuf.BoolValue

Should the connection be closed after each request.

shareConnection : google.protobuf.BoolValue

Should a connection be shared for some requests.

ClickhouseSource

db : string

Name of the ClickHouse database.

table : string

Name of the table in the specified database to be used as the dictionary source.

host : string

ClickHouse host of the specified database.

port : int64

Port to use when connecting to the host.

user : string

Name of the ClickHouse database user.

password : string

Password of the ClickHouse database user.

where : string

Selection criteria for the data in the specified ClickHouse table.

secure : google.protobuf.BoolValue

Use ssl for connection.

MongodbSource

db : string

Name of the MongoDB database.

collection : string

Name of the collection in the specified database to be used as the dictionary source.

host : string

MongoDB host of the specified database.

port : int64

Port to use when connecting to the host.

user : string

Name of the MongoDB database user.

password : string

Password of the MongoDB database user.

options : string

PostgresqlSource

SslMode
  • SSL_MODE_UNSPECIFIED

  • DISABLE

    Only try a non-SSL connection.

  • ALLOW

    First try a non-SSL connection; if that fails, try an SSL connection.

  • PREFER

    First try an SSL connection; if that fails, try a non-SSL connection.

  • VERIFY_CA

    Only try an SSL connection, and verify that the server certificate is issued by a trusted certificate authority (CA).

  • VERIFY_FULL

    Only try an SSL connection, verify that the server certificate is issued by a trusted CA and that the requested server host name matches that in the certificate.

db : string

Name of the PostrgreSQL database.

table : string

Name of the table in the specified database to be used as the dictionary source.

hosts : string

Name of the PostrgreSQL host

port : int64

Port to use when connecting to the host.

user : string

Name of the PostrgreSQL database user.

password : string

Password of the PostrgreSQL database user.

invalidateQuery : string

Query for checking the dictionary status, to pull only updated data. For more details, see ClickHouse documentation on dictionaries.

sslMode : SslMode

Mode of SSL TCP/IP connection to the PostgreSQL host. For more details, see PostgreSQL documentation.